Skip to content

ToolOutputs

Namespace: Vercel.AI.Prompt

public static class ToolOutputs

Builds the model-facing tool result. Maps to createToolModelOutput.

Inheritance: object

View source

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

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product