Skip to content

ToolChoice

Namespace: Vercel.AI.Provider

public abstract class ToolChoice

How the model should choose tools. Maps to toolChoice.

Inheritance: object

Derived: ToolChoice.NamedChoice

View source

public static ToolChoice Auto { get; }

The model may call tools.

Value: ToolChoice

View source

public static ToolChoice None { get; }

The model must not call tools.

Value: ToolChoice

View source

public static ToolChoice Required { get; }

The model must call a tool.

Value: ToolChoice

View source

public string Type { get; }

Choice type: auto, none, required, or tool.

Value: string

View source

public static ToolChoice Tool(string toolName)

The model must call <code class=“paramref”>toolName</code>.

Parameters

Name Type Description
toolName string

Returns: ToolChoice

View source

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