Skip to content

BatchTool

Namespace: Vercel.AI.Operations

public sealed class BatchTool

A tool definition forwarded to a batch without being executed.

Inheritance: object

View source

BatchTool(string, JsonElement, string?, Func<JsonElement, CancellationToken, Task<object?>>?)

Section titled “BatchTool(string, JsonElement, string?, Func<JsonElement, CancellationToken, Task<object?>>?)”
public BatchTool(string name, JsonElement inputSchema, string? description = null, Func<JsonElement, CancellationToken, Task<object?>>? execute = null)

Creates a tool definition.

Parameters

Name Type Description
name string
inputSchema JsonElement
description string
execute Func<JsonElement, CancellationToken, Task<object>>

View source

public string? Description { get; }

Description.

Value: string

View source

public Func<JsonElement, CancellationToken, Task<object?>>? Execute { get; }

Local execute function. Batch submission does not call it.

Value: Func<JsonElement, CancellationToken, Task<object>>

View source

public JsonElement InputSchema { get; }

JSON schema.

Value: JsonElement

View source

public string Name { get; }

Tool name.

Value: string

View source

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