The following request works on OpenAI API, but fails on Azure OpenAI with this error:
data: {"code":500,"message":"stream error: (error, status code: 400, message: Missing parameter 'name': messages with role 'function' must have a 'name'.)","model":"","choices":null}
{
"model": "gpt-4-0613",
"messages": [
{
"role": "system",
"content": ""
},
{
"role": "user",
"content": "What is the weather like in Boston?"
},
{
"role": "assistant",
"content": "What is the weather like in Boston?",
"function_call":{"name":"get_current_weather","arguments":"{\n \u0022location\u0022: \u0022Boston, MA\u0022\n}"}
},
{
"name": "get_current_weather",
"role": "function",
"content": "20 C"
}
],
"temperature": 0.001,
"top_p": 1,
"n": 1,
"stream": true,
"max_tokens": null,
"presence_penalty": 0,
"frequency_penalty": 0,
"functions": [
{
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
],
"function_call": "auto"
}