Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    object
    ToolChoice
    AllowedTools
    CustomToolChoice
    FunctionToolChoice
    HostedToolChoice
    McpToolChoice
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Glitch9.AIDevKit
    Assembly: Glitch9.AIDevKit.dll
    Syntax
    [JsonConverter(typeof(ToolChoiceConverter))]
    public class ToolChoice

    Fields

    | Edit this page View Source

    Type_AllowedTools

    Declaration
    public const string Type_AllowedTools = "allowed_tools"
    Field Value
    Type Description
    string
    | Edit this page View Source

    Type_Custom

    Declaration
    public const string Type_Custom = "custom"
    Field Value
    Type Description
    string
    | Edit this page View Source

    Type_Function

    Declaration
    public const string Type_Function = "function"
    Field Value
    Type Description
    string
    | Edit this page View Source

    Type_Mcp

    Declaration
    public const string Type_Mcp = "mcp"
    Field Value
    Type Description
    string

    Properties

    | Edit this page View Source

    Mode

    Declaration
    [JsonProperty("mode")]
    public ToolChoiceMode? Mode { get; set; }
    Property Value
    Type Description
    ToolChoiceMode?
    | Edit this page View Source

    Type

    Declaration
    [JsonProperty("type")]
    public virtual string Type { get; }
    Property Value
    Type Description
    string

    Methods

    | Edit this page View Source

    AllowedTools(ToolChoiceMode, List<Tool>)

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

    Declaration
    public static ToolChoice AllowedTools(ToolChoiceMode mode, List<Tool> tools)
    Parameters
    Type Name Description
    ToolChoiceMode mode
    List<Tool> tools
    Returns
    Type Description
    ToolChoice
    | Edit this page View Source

    Auto()

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

    Declaration
    public static ToolChoice Auto()
    Returns
    Type Description
    ToolChoice
    | Edit this page View Source

    Custom(string)

    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
    Type Description
    ToolChoice
    | Edit this page View Source

    Function(string)

    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
    Type Description
    ToolChoice
    | Edit this page View Source

    None()

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

    Declaration
    public static ToolChoice None()
    Returns
    Type Description
    ToolChoice
    | Edit this page View Source

    Required()

    The model must call one or more tools.

    Declaration
    public static ToolChoice Required()
    Returns
    Type Description
    ToolChoice

    Extension Methods

    ArrayExtensions.ToArrayOrEmpty<T>(T)
    ArrayExtensions.ToArrayOrNull<T>(T)
    EventExtensions.ToDelta<T>(T, string, int, string, bool)
    EventExtensions.ToDone<T>(T, string, int, string)
    EventExtensions.ToEvent<T>(T)
    EventExtensions.UpcastDelta<T1, T2>(T1, string, int, string, bool)
    FallbackExtensions.IsOr<TParent, TChild>(TParent, TChild)
    ResponseCastingExtensions.GetResult<T>(T)
    SystemExtensions.GetName(object)
    • Edit this page
    • View Source
    In this article
    Back to top AI DevKit Documentation