"tool_choice": "required" sometimes not supported in Azure OpenAI service in 2024-07-01-preview
I am experimenting with the new API version 2024-07-01-preview
which supports "tool_choice": "required"
. I noticed that this option is intermittently not supported (i.e. when I send the same request repeatedly, I sometimes receive error 400)
I receive a successful response only in 50% of my requests. In the other cases, I receive
Error code: 400 - {'error': {'message': "Invalid value: 'required'. Supported values are: 'none' and 'auto'.", 'type': 'invalid_request_error', 'param': 'tool_choice', 'code': 'invalid_value'}}
It seems to me the API version hasn't been consistently rolled out yet?
Here is my demo request that I send
{
"messages": [
{
"content": "What's the current time in San Francisco, Tokyo, and Paris?",
"role": "user"
}
],
"model": "gpt-4o-2024-05-13",
"max_tokens": 500,
"n": 1,
"stream": false,
"temperature": 0.0,
"tool_choice": "required",
"tools": [
{
"type": "function",
"function": {
"name": "get_current_time",
"description": "Get the current time in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city name, e.g. San Francisco"
}
},
"required": [
"location"
]
}
}
}
]
}