Skip to content

Schema of tool_choice parameter #19

@souhailaS

Description

@souhailaS

According to: https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_tool_choice_option_param.py#L12
and https://github.com/openai/openai-python/blob/main/src/openai/types/chat/chat_completion_named_tool_choice_param.py#L15
and (deepseek-ai/DeepSeek-V2#71)

{
  "tool_choice": {
    "type": "object",
     "description": "Defines the tool selection options for chat completion.",
     "oneOf": [
        {
          "type": "string",
          "enum": ["none", "auto", "required"],
          "description": "Specifies how the model should choose tools. 'none' disables tools, 'auto' lets the model decide, and 'required' mandates a tool."
        },
        {
          "type": "object",
          "description": "Explicitly specifies a function tool for the model to use.",
          "required": ["type", "function"],
          "properties": {
            "type": {
              "type": "string",
              "enum": ["function"],
              "description": "The type of the tool. Currently, only 'function' is supported."
            },
            "function": {
              "type": "object",
              "required": ["name"],
              "properties": {
                "name": {
                  "type": "string",
                  "description": "The name of the function to call."
                }
              }
            }
          }
        }
      ]
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions