StepResult
Namespace: Vercel.AI
public sealed class StepResultOne language-model step, including any tool results from that step.
Inheritance: object
Constructors
Section titled “Constructors”StepResult(string, string?, IReadOnlyList<GeneratedToolCall>, IReadOnlyList<ExecutedTool>, FinishReason, LanguageModelUsage, IReadOnlyList<GeneratedSource>, JsonElement?, IReadOnlyList<CallWarning>?, IReadOnlyList<GeneratedFile>?, string?, string?, IReadOnlyList<GeneratedContent>?, StepPerformance?, LanguageModelRequestMetadata?, StepResponse?, string?)
Section titled “StepResult(string, string?, IReadOnlyList<GeneratedToolCall>, IReadOnlyList<ExecutedTool>, FinishReason, LanguageModelUsage, IReadOnlyList<GeneratedSource>, JsonElement?, IReadOnlyList<CallWarning>?, IReadOnlyList<GeneratedFile>?, string?, string?, IReadOnlyList<GeneratedContent>?, StepPerformance?, LanguageModelRequestMetadata?, StepResponse?, string?)”public StepResult(string text, string? reasoningText, IReadOnlyList<GeneratedToolCall> toolCalls, IReadOnlyList<ExecutedTool> toolResults, FinishReason finishReason, LanguageModelUsage usage, IReadOnlyList<GeneratedSource> sources, JsonElement? providerMetadata = null, IReadOnlyList<CallWarning>? warnings = null, IReadOnlyList<GeneratedFile>? files = null, string? provider = null, string? modelId = null, IReadOnlyList<GeneratedContent>? content = null, StepPerformance? performance = null, LanguageModelRequestMetadata? request = null, StepResponse? response = null, string? rawFinishReason = null)Creates a step result.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | |
reasoningText |
string | |
toolCalls |
IReadOnlyList<GeneratedToolCall> | |
toolResults |
IReadOnlyList<ExecutedTool> | |
finishReason |
FinishReason | |
usage |
LanguageModelUsage | |
sources |
IReadOnlyList<GeneratedSource> | |
providerMetadata |
JsonElement? | |
warnings |
IReadOnlyList<CallWarning> | |
files |
IReadOnlyList<GeneratedFile> | |
provider |
string | |
modelId |
string | |
content |
IReadOnlyList<GeneratedContent> | |
performance |
StepPerformance | |
request |
LanguageModelRequestMetadata | |
response |
StepResponse | |
rawFinishReason |
string |
Properties
Section titled “Properties”Content
Section titled “Content”public IReadOnlyList<GeneratedContent> Content { get; }Content the model generated in this step, in order, followed by the results of the client tools the loop ran. A call that failed to parse stays here as an Invalid call, followed by its error result. A GeneratedText carries its Citations, separate from the retrieved Sources.
Value: IReadOnlyList<GeneratedContent>
public IReadOnlyList<GeneratedFile> Files { get; }Files generated in this step.
Value: IReadOnlyList<GeneratedFile>
FinishReason
Section titled “FinishReason”public FinishReason FinishReason { get; }Finish reason.
Value: FinishReason
ModelId
Section titled “ModelId”public string? ModelId { get; }Model id of the model that produced this step, when known.
Value: string
Performance
Section titled “Performance”public StepPerformance Performance { get; }Performance metrics of this step. Streaming-only metrics are <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> for generateText.
Value: StepPerformance
Provider
Section titled “Provider”public string? Provider { get; }Provider id of the model that produced this step, when known.
Value: string
ProviderMetadata
Section titled “ProviderMetadata”public JsonElement? ProviderMetadata { get; }Provider metadata for this step, including cost and native-tool counts when the provider sent them.
Value: JsonElement?
RawFinishReason
Section titled “RawFinishReason”public string? RawFinishReason { get; }The finish reason exactly as the provider reported it, or <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a> when the provider reported none. Maps to rawFinishReason.
Value: string
ReasoningText
Section titled “ReasoningText”public string? ReasoningText { get; }Reasoning text generated in this step.
Value: string
Request
Section titled “Request”public LanguageModelRequestMetadata Request { get; }Additional request information for this step. Body and Messages
are set only when Include asks for them. Maps to request.
Value: LanguageModelRequestMetadata
Response
Section titled “Response”public StepResponse Response { get; }Additional response information for this step, with the messages this step added to the conversation. Maps to response.
Value: StepResponse
Sources
Section titled “Sources”public IReadOnlyList<GeneratedSource> Sources { get; }Sources cited in this step.
Value: IReadOnlyList<GeneratedSource>
public string Text { get; }Text generated in this step.
Value: string
ToolCalls
Section titled “ToolCalls”public IReadOnlyList<GeneratedToolCall> ToolCalls { get; }Tool calls from this step.
Value: IReadOnlyList<GeneratedToolCall>
ToolResults
Section titled “ToolResults”public IReadOnlyList<ExecutedTool> ToolResults { get; }Tool results from this step.
Value: IReadOnlyList<ExecutedTool>
public LanguageModelUsage Usage { get; }Usage for this step.
Value: LanguageModelUsage
Warnings
Section titled “Warnings”public IReadOnlyList<CallWarning> Warnings { get; }Warnings reported for this step.
Value: IReadOnlyList<CallWarning>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product