Share via


ChatCompletionsToolChoice Class

Definition

Represents an optional control that specifies which, if any, tools may be called by the model while processing a chat completions request.

public class ChatCompletionsToolChoice
type ChatCompletionsToolChoice = class
Public Class ChatCompletionsToolChoice
Inheritance
ChatCompletionsToolChoice

Remarks

Note: with 1106 model revisions, constraining the model to a specific function via tool_choice will provide a finish_reason of 'stop'. Please check for 'tool_calls' rather than relying on a consistent finish_reason.

Constructors

ChatCompletionsToolChoice(ChatCompletionsToolDefinition)

Initializes a new instance of ChatCompletionsToolChoice that requests the model constrains its response to calling a provided function tool definition that matches the name of the provided FunctionDefinition.

ChatCompletionsToolChoice(FunctionDefinition)

Initializes a new instance of ChatCompletionsToolChoice that requests the model constrains its response to calling a provided function tool that matches the name of the provided FunctionDefinition.

Fields

Auto

Specifies that the model may either use any of the tools provided in this chat completions request or instead return a standard chat completions response as if no tools were provided.

None

Specifies that the model should not respond with a tool call and should instead provide a standard chat completions response. Response content may still be influenced by the provided tool definitions.

Required

Specifies that the model should respond with a call to one or more tools.

Operators

Implicit(ChatCompletionsToolDefinition to ChatCompletionsToolChoice)
Implicit(FunctionDefinition to ChatCompletionsToolChoice)

Applies to