Class ToolChoice
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.
Assembly: Glitch9.AIDevKit.dll
[JsonConverter(typeof(ToolChoiceConverter))]
public class ToolChoice
Fields
|
Edit this page
View Source
Declaration
public const string Type_AllowedTools = "allowed_tools"
Field Value
|
Edit this page
View Source
Declaration
public const string Type_Custom = "custom"
Field Value
|
Edit this page
View Source
Declaration
public const string Type_Function = "function"
Field Value
|
Edit this page
View Source
Declaration
public const string Type_Mcp = "mcp"
Field Value
Properties
|
Edit this page
View Source
Declaration
[JsonProperty("mode")]
public ToolChoiceMode? Mode { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[JsonProperty("type")]
public virtual string Type { get; }
Property Value
Methods
|
Edit this page
View Source
Constrains the tools available to the model to a pre-defined set.
Declaration
public static ToolChoice AllowedTools(ToolChoiceMode mode, List<Tool> tools)
Parameters
Returns
|
Edit this page
View Source
The model can pick between generating a message or calling one or more tools.
Declaration
public static ToolChoice Auto()
Returns
|
Edit this page
View Source
Specifies a tool the model should use. Use to force the model to call a specific custom tool.
Declaration
public static ToolChoice Custom(string customToolName)
Parameters
| Type |
Name |
Description |
| string |
customToolName |
|
Returns
|
Edit this page
View Source
Specifies a tool the model should use. Use to force the model to call a specific function.
Declaration
public static ToolChoice Function(string functionName)
Parameters
| Type |
Name |
Description |
| string |
functionName |
|
Returns
|
Edit this page
View Source
The model will not call any tool and instead generates a message.
Declaration
public static ToolChoice None()
Returns
|
Edit this page
View Source
The model must call one or more tools.
Declaration
public static ToolChoice Required()
Returns
Extension Methods