ToolOutputs
Namespace: Vercel.AI.Prompt
public static class ToolOutputsBuilds the model-facing tool result. Maps to createToolModelOutput.
Inheritance: object
Methods
Section titled “Methods”CreateToolModelOutput(string, JsonElement?, object?, bool, Func<ToolModelOutputCall, ToolModelOutput>?, string)
Section titled “CreateToolModelOutput(string, JsonElement?, object?, bool, Func<ToolModelOutputCall, ToolModelOutput>?, string)”public static ToolModelOutput CreateToolModelOutput(string toolCallId, JsonElement? input, object? output, bool hasOutput, Func<ToolModelOutputCall, ToolModelOutput>? toModelOutput, string errorMode)Converts a tool output. <code class=“paramref”>errorMode</code> is text, json, or none.
Set <code class=“paramref”>hasOutput</code> to false when the output is undefined.
Parameters
| Name | Type | Description |
|---|---|---|
toolCallId |
string | |
input |
JsonElement? | |
output |
object | |
hasOutput |
bool | |
toModelOutput |
Func<ToolModelOutputCall, ToolModelOutput> | |
errorMode |
string |
Returns: ToolModelOutput
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product