Meta-Llama-3.1-8B-Instruct
Meta-Llama-3.3-70B-Instruct
DeepSeek-V3-0324
tools
parameter and set tool_choice
to the following:
auto
: allows the model to choose between generating a message or calling a function. This is the default tool choice when the field is not specified.required
: This forces the model to generate a function call. The model will then always select one or more function(s) to call.tool_choice = {"type": "function", "function": {"name": "get_weather"}}
. This ensures the model will only use the specified function.tool_calls
in the response. Extract the function call details and execute the corresponding function with the provided parameters.
response_format
parameter to your defined schema to ensure the model produces a JSON object that matches your specified structure.
"strict"
parameter to false
, as true
isn’t supported yet. When it is available, it will ensure the model strictly follows your function schema instead of making a best-effort attempt.response_format
parameter to json_object
in your request to ensure that the model outputs a valid JSON. In case the mode is not able to generate a valid JSON, an error will be returned.