Freigeben über


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

  • None is the default when no tools are provided and specifies that the model should not use any tools and instead always generate a message. Note that available tools may still influence the content of messages as generated by the model even when they are not or cannot be selected.
  • Auto is the default when tools are provided and specifies that the model should freely determine if, and which, tools should be called instead of generating a message.
  • Providing a FunctionDefinition or ChatCompletionsToolDefinition will request that the model constrains its response to only calling the specified function tool.
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

Name Description
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

Name Description
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

Name Description
Implicit(ChatCompletionsToolDefinition to ChatCompletionsToolChoice)
Implicit(FunctionDefinition to ChatCompletionsToolChoice)

Applies to