Azure / Azure/azure-rest-api-specs
[BUG] Missing support for the parallel_tool_calls parameter in Azure openAI API
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/preview/2024-05-01-preview/generated.json
### API Spec version
2024-05-01 preview
### Describe the bug
support for the `parallel_tool_calls` parameter on the OpenAI API Spec: https://platform.openai.com/docs/api-reference/chat/create#chat-create-parallel_tool_calls is not implemented in the Azure API spec
Appears to be the cause of this issue filed on the OpenAI repo: https://github.com/openai/openai-python/issues/1492
### Expected behavior
Use parameter as described in: https://platform.openai.com/docs/api-reference/chat/create#chat-create-parallel_tool_calls
### Actual behavior
`openai.BadRequestError: Error code: 400 - {'error': {'message': 'Unrecognized request argument supplied: parallel_tool_calls. Please contact us through an Azure support request at: https://go.microsoft.com/fwlink/?linkid=2213926 for further questions.', 'type':
'invalid_request_error', 'param': None, 'code': None}}`
### Reproduction Steps
```python
from openai import AzureOpenAI # version 1.35.3
from azure.identity import DefaultAzureCredential, AzureAuthorityHosts, get_bearer_token_provider
token_provider = get_bearer_token_provider(...) # insert your token provider details here
client = AzureOpenAI(
api_version="2024-05-01-preview",
azure_endpoint="...", # insert your endpoint here
azure_ad_token_provider=token_provider,
)
response = client.chat.completions.create(
model="...", # insert your model here
messages=[
{"role": 'user', "content": 'Please use a tool'}
],
stream=False,
tools=[{
'type': 'function',
'function': {
'name': 'tool',
'description': "A sample tool.",
'parameters': {
'properties': {
'input_1': {
'description': 'a list of integers for the tool',
'items': {'type': 'integer'},
'title': 'Ranked text chunk indices', 'type': 'array'
}
},
'required': ['input_1'],
'title': 'Input for `tool`',
'type': 'object'
}
}
}],
tool_choice='auto',
parallel_tool_calls=False,
)
print(response)
```
### Environment
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.