Table of Contents

Class ToolChoice

Namespace
Glitch9.AIDevKit

This can be a String or an Object Specifies a tool the model should use. Use to force the model to call a specific tool.

public class ToolChoice
Inheritance
object
ToolChoice
Derived

Fields

Type_AllowedTools

public const string Type_AllowedTools = "allowed_tools"

Field Value

string

Type_Custom

public const string Type_Custom = "custom"

Field Value

string

Type_Function

public const string Type_Function = "function"

Field Value

string

Type_Mcp

public const string Type_Mcp = "mcp"

Field Value

string

Properties

Mode

public ToolChoiceMode? Mode { get; set; }

Property Value

ToolChoiceMode?

Type

public virtual string Type { get; }

Property Value

string

Methods

AllowedTools(ToolChoiceMode, List<Tool>)

Constrains the tools available to the model to a pre-defined set.

public static ToolChoice AllowedTools(ToolChoiceMode mode, List<Tool> tools)

Parameters

mode ToolChoiceMode
tools List<Tool>

Returns

ToolChoice

Auto()

The model can pick between generating a message or calling one or more tools.

public static ToolChoice Auto()

Returns

ToolChoice

Custom(string)

Specifies a tool the model should use. Use to force the model to call a specific custom tool.

public static ToolChoice Custom(string customToolName)

Parameters

customToolName string

Returns

ToolChoice

Function(string)

Specifies a tool the model should use. Use to force the model to call a specific function.

public static ToolChoice Function(string functionName)

Parameters

functionName string

Returns

ToolChoice

None()

The model will not call any tool and instead generates a message.

public static ToolChoice None()

Returns

ToolChoice

Required()

The model must call one or more tools.

public static ToolChoice Required()

Returns

ToolChoice