Instructions
Namespace: Vercel.AI.Prompt
public sealed class InstructionsInstructions for a call: a string, one system message, or a list of system messages.
Maps to Instructions. A single system message is kept as a one-item Messages list.
Inheritance: object
Properties
Section titled “Properties”Messages
Section titled “Messages”public IReadOnlyList<SystemModelMessage>? Messages { get; }The system messages, when the instructions are one or more system messages.
Value: IReadOnlyList<SystemModelMessage>
public string? Text { get; }The instruction text, when the instructions are a string.
Value: string
Methods
Section titled “Methods”From(IReadOnlyList<SystemModelMessage>)
Section titled “From(IReadOnlyList<SystemModelMessage>)”public static Instructions From(IReadOnlyList<SystemModelMessage> messages)Creates instructions from a list of system messages.
Parameters
| Name | Type | Description |
|---|---|---|
messages |
IReadOnlyList<SystemModelMessage> |
Returns: Instructions
From(string)
Section titled “From(string)”public static Instructions From(string text)Creates instructions from a string.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: Instructions
From(SystemModelMessage)
Section titled “From(SystemModelMessage)”public static Instructions From(SystemModelMessage message)Creates instructions from one system message.
Parameters
| Name | Type | Description |
|---|---|---|
message |
SystemModelMessage |
Returns: Instructions
Operators
Section titled “Operators”implicit operator Instructions(string)
Section titled “implicit operator Instructions(string)”public static implicit operator Instructions(string text)Converts a string to instructions.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string |
Returns: Instructions
implicit operator Instructions(SystemModelMessage)
Section titled “implicit operator Instructions(SystemModelMessage)”public static implicit operator Instructions(SystemModelMessage message)Converts a system message to instructions.
Parameters
| Name | Type | Description |
|---|---|---|
message |
SystemModelMessage |
Returns: Instructions
implicit operator Instructions(SystemModelMessage[])
Section titled “implicit operator Instructions(SystemModelMessage[])”public static implicit operator Instructions(SystemModelMessage[] messages)Converts an array of system messages to instructions.
Parameters
| Name | Type | Description |
|---|---|---|
messages |
SystemModelMessage\[\] |
Returns: Instructions
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product