LanguageModelTool
Namespace: Vercel.AI.Provider
public sealed class LanguageModelToolA function tool definition sent to the model.
Inheritance: object
Constructors
Section titled “Constructors”LanguageModelTool(string, string?, JsonElement, bool?)
Section titled “LanguageModelTool(string, string?, JsonElement, bool?)”public LanguageModelTool(string name, string? description, JsonElement inputSchema, bool? strict = null)Creates a function tool.
Parameters
| Name | Type | Description |
|---|---|---|
name |
string | |
description |
string | |
inputSchema |
JsonElement | |
strict |
bool? |
Properties
Section titled “Properties”public JsonElement Args { get; }Arguments of a provider-defined tool. Undefined for a function tool.
Value: JsonElement
Description
Section titled “Description”public string? Description { get; }Tool description.
Value: string
InputSchema
Section titled “InputSchema”public JsonElement InputSchema { get; }JSON Schema for the arguments.
Value: JsonElement
IsProviderDefined
Section titled “IsProviderDefined”public bool IsProviderDefined { get; }Whether this is a provider-defined tool rather than a function tool.
Value: bool
public string Name { get; }Tool name.
Value: string
OutputSchema
Section titled “OutputSchema”public JsonElement? OutputSchema { get; init; }JSON Schema for the tool result. OpenAI Responses parses the result as JSON, so text results of this tool are sent as JSON string literals.
Value: JsonElement?
ProviderOptions
Section titled “ProviderOptions”public JsonElement? ProviderOptions { get; init; }Provider options of the tool, keyed by provider name, such as { "openai": { "omitFromRequestTools": true } }.
Maps to the tool’s providerOptions.
Value: JsonElement?
ProviderToolId
Section titled “ProviderToolId”public string? ProviderToolId { get; }Provider-defined tool id, or null for a function tool.
Value: string
Strict
Section titled “Strict”public bool? Strict { get; }Responses strict mode. Null means unset, which Responses sends as false.
Value: bool?
Methods
Section titled “Methods”ProviderDefined(string, string, JsonElement)
Section titled “ProviderDefined(string, string, JsonElement)”public static LanguageModelTool ProviderDefined(string id, string name, JsonElement args)Creates a provider-defined tool. Maps to { type: 'provider', id, name, args }.
<code class=“paramref”>id</code> is <provider>.<tool>. <code class=“paramref”>args</code> must be a JSON object.
Parameters
| Name | Type | Description |
|---|---|---|
id |
string | |
name |
string | |
args |
JsonElement |
Returns: LanguageModelTool
Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product