PrepareStepContext
Namespace: Vercel.AI
public sealed class PrepareStepContextContext passed to prepareStep.
Inheritance: object
Constructors
Section titled “Constructors”PrepareStepContext(int, IReadOnlyList<StepResult>)
Section titled “PrepareStepContext(int, IReadOnlyList<StepResult>)”public PrepareStepContext(int stepNumber, IReadOnlyList<StepResult> steps)Creates context.
Parameters
| Name | Type | Description |
|---|---|---|
stepNumber |
int | |
steps |
IReadOnlyList<StepResult> |
PrepareStepContext(int, IReadOnlyList<StepResult>, IReadOnlyList<ModelMessage>, ILanguageModel)
Section titled “PrepareStepContext(int, IReadOnlyList<StepResult>, IReadOnlyList<ModelMessage>, ILanguageModel)”public PrepareStepContext(int stepNumber, IReadOnlyList<StepResult> steps, IReadOnlyList<ModelMessage> messages, ILanguageModel model)Creates context with the prompt and model the step is about to use.
Parameters
| Name | Type | Description |
|---|---|---|
stepNumber |
int | |
steps |
IReadOnlyList<StepResult> | |
messages |
IReadOnlyList<ModelMessage> | |
model |
ILanguageModel |
PrepareStepContext(int, IReadOnlyList<StepResult>, IReadOnlyList<ModelMessage>, ILanguageModel, Instructions?, Instructions?, IReadOnlyList<ModelMessage>, IReadOnlyList<ModelMessage>)
Section titled “PrepareStepContext(int, IReadOnlyList<StepResult>, IReadOnlyList<ModelMessage>, ILanguageModel, Instructions?, Instructions?, IReadOnlyList<ModelMessage>, IReadOnlyList<ModelMessage>)”public PrepareStepContext(int stepNumber, IReadOnlyList<StepResult> steps, IReadOnlyList<ModelMessage> messages, ILanguageModel model, Instructions? instructions, Instructions? initialInstructions, IReadOnlyList<ModelMessage> initialMessages, IReadOnlyList<ModelMessage> responseMessages)Creates context with the instructions and the initial and response messages of the call.
Parameters
| Name | Type | Description |
|---|---|---|
stepNumber |
int | |
steps |
IReadOnlyList<StepResult> | |
messages |
IReadOnlyList<ModelMessage> | |
model |
ILanguageModel | |
instructions |
Instructions | |
initialInstructions |
Instructions | |
initialMessages |
IReadOnlyList<ModelMessage> | |
responseMessages |
IReadOnlyList<ModelMessage> |
Properties
Section titled “Properties”InitialInstructions
Section titled “InitialInstructions”public Instructions? InitialInstructions { get; }The instructions the call started with. Null when there are none.
Value: Instructions
InitialMessages
Section titled “InitialMessages”public IReadOnlyList<ModelMessage> InitialMessages { get; }The messages the call started with, without the instructions. Empty when the caller built the context without them.
Value: IReadOnlyList<ModelMessage>
Instructions
Section titled “Instructions”public Instructions? Instructions { get; }The instructions the step is about to send. A Instructions override carries forward to later steps. Null when there are none.
Value: Instructions
Messages
Section titled “Messages”public IReadOnlyList<ModelMessage> Messages { get; }The messages the step is about to send, without the instructions: the prompt plus the responses of the earlier steps. A Messages override carries forward to later steps. Empty when the caller built the context without them.
Value: IReadOnlyList<ModelMessage>
public ILanguageModel? Model { get; }The model the step is about to use, or null when the caller built the context without it.
Value: ILanguageModel
ResponseMessages
Section titled “ResponseMessages”public IReadOnlyList<ModelMessage> ResponseMessages { get; }The response messages the earlier steps added. Empty when the caller built the context without them.
Value: IReadOnlyList<ModelMessage>
StepNumber
Section titled “StepNumber”public int StepNumber { get; }Zero-based step index about to run.
Value: int
public IReadOnlyList<StepResult> Steps { get; }Steps already completed.
Value: IReadOnlyList<StepResult>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product