GeneratedToolResult
Namespace: Vercel.AI.Provider
public sealed class GeneratedToolResult : GeneratedContentA tool result: one the provider produced itself, such as a web or file search, or one the generation loop produced by running a client tool.
Inheritance: object → GeneratedContent
Constructors
Section titled “Constructors”GeneratedToolResult(string, string, string, bool)
Section titled “GeneratedToolResult(string, string, string, bool)”public GeneratedToolResult(string toolCallId, string toolName, string resultJson, bool isError = false)Creates a provider-executed tool result.
Parameters
| Name | Type | Description |
|---|---|---|
toolCallId |
string | |
toolName |
string | |
resultJson |
string | |
isError |
bool |
Properties
Section titled “Properties”Dynamic
Section titled “Dynamic”public bool Dynamic { get; init; }True when the tool is dynamic. Maps to the result’s dynamic.
Value: bool
public Exception? Error { get; init; }The exception the tool threw, when the generation loop ran a client tool that failed.
Value: Exception
IsError
Section titled “IsError”public bool IsError { get; }Whether the tool failed.
Value: bool
ProviderMetadata
Section titled “ProviderMetadata”public JsonElement? ProviderMetadata { get; init; }Provider-specific metadata for this result, keyed by provider name.
Value: JsonElement?
ResultJson
Section titled “ResultJson”public string ResultJson { get; }JSON result.
Value: string
ToolCallId
Section titled “ToolCallId”public string ToolCallId { get; }Matching tool call id.
Value: string
ToolMetadata
Section titled “ToolMetadata”public IReadOnlyDictionary<string, JsonElement>? ToolMetadata { get; init; }Metadata of the tool, apart from provider metadata. Maps to the result’s toolMetadata.
Value: IReadOnlyDictionary<string, JsonElement>
ToolName
Section titled “ToolName”public string ToolName { get; }Tool name.
Value: string
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product