GenerateTextResult
Namespace: Vercel.AI
public sealed class GenerateTextResultResult of generateText.
Inheritance: object
Constructors
Section titled “Constructors”GenerateTextResult(string, string?, IReadOnlyList<StepResult>, FinishReason, LanguageModelUsage, JsonElement?, IReadOnlyList<GeneratedSource>, JsonElement?)
Section titled “GenerateTextResult(string, string?, IReadOnlyList<StepResult>, FinishReason, LanguageModelUsage, JsonElement?, IReadOnlyList<GeneratedSource>, JsonElement?)”public GenerateTextResult(string text, string? reasoningText, IReadOnlyList<StepResult> steps, FinishReason finishReason, LanguageModelUsage usage, JsonElement? output, IReadOnlyList<GeneratedSource> sources, JsonElement? providerMetadata = null)Creates a result.
Parameters
| Name | Type | Description |
|---|---|---|
text |
string | |
reasoningText |
string | |
steps |
IReadOnlyList<StepResult> | |
finishReason |
FinishReason | |
usage |
LanguageModelUsage | |
output |
JsonElement? | |
sources |
IReadOnlyList<GeneratedSource> | |
providerMetadata |
JsonElement? |
Properties
Section titled “Properties”Content
Section titled “Content”public IReadOnlyList<GeneratedContent> Content { get; }Content from the last step. See Content.
Value: IReadOnlyList<GeneratedContent>
public IReadOnlyList<GeneratedFile> Files { get; }Files from every step.
Value: IReadOnlyList<GeneratedFile>
FinalStep
Section titled “FinalStep”public StepResult FinalStep { get; }The last completed step.
Value: StepResult
FinishReason
Section titled “FinishReason”public FinishReason FinishReason { get; }Finish reason of the last step.
Value: FinishReason
Output
Section titled “Output”public JsonElement? Output { get; }Parsed structured output, when String) was used.
Value: JsonElement?
ProviderMetadata
Section titled “ProviderMetadata”public JsonElement? ProviderMetadata { get; }Provider metadata from the last step.
Value: JsonElement?
ReasoningText
Section titled “ReasoningText”public string? ReasoningText { get; }Reasoning from the last step.
Value: string
Request
Section titled “Request”public LanguageModelRequestMetadata Request { get; }Additional request information of the last step. Maps to request. GenerateTextOptions has no include option yet, so Body and Messages are <a href=“https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null">null</a>.
Value: LanguageModelRequestMetadata
Response
Section titled “Response”public StepResponse Response { get; }Additional response information of the last step. Maps to response.
Value: StepResponse
ResponseMessages
Section titled “ResponseMessages”public IReadOnlyList<ModelMessage> ResponseMessages { get; init; }Messages this call added to the conversation: the assistant message of each step, with any tool approval request, and the tool results the client ran. Pass them back with the caller’s approval responses to continue the conversation.
Value: IReadOnlyList<ModelMessage>
Sources
Section titled “Sources”public IReadOnlyList<GeneratedSource> Sources { get; }Sources from every step.
Value: IReadOnlyList<GeneratedSource>
public IReadOnlyList<StepResult> Steps { get; }Every step.
Value: IReadOnlyList<StepResult>
public string Text { get; }Text from the last step.
Value: string
ToolCalls
Section titled “ToolCalls”public IReadOnlyList<GeneratedToolCall> ToolCalls { get; }Tool calls from every step.
Value: IReadOnlyList<GeneratedToolCall>
ToolResults
Section titled “ToolResults”public IReadOnlyList<ExecutedTool> ToolResults { get; }Tool results from every step.
Value: IReadOnlyList<ExecutedTool>
public LanguageModelUsage Usage { get; }Usage summed across steps.
Value: LanguageModelUsage
Warnings
Section titled “Warnings”public IReadOnlyList<CallWarning> Warnings { get; }Warnings from every step.
Value: IReadOnlyList<CallWarning>
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product