You have the answer in diagram and more details in the link.
Tool choice
By default the model will determine when and how many tools to use. You can force specific behavior with the tool_choice
parameter.
-
Auto: (Default) Call zero, one, or multiple functions.
tool_choice: "auto"
-
Required: Call one or more functions.
tool_choice: "required"
-
Forced Function: Call exactly one specific function.
tool_choice: {"type": "function", "name": "get_weather"}