Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Missing support for the parallel_tool_calls parameter in Azure openAI API #29545

Open
gregwdata opened this issue Jun 21, 2024 · 5 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@gregwdata
Copy link

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: openai/openai-python#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

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

@gregwdata gregwdata added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 21, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Jun 21, 2024
@gregwdata gregwdata changed the title [BUG] [BUG] Missing support for the parallel_tool_calls parameter in Azure openAI API Jun 21, 2024
@wooters
Copy link

wooters commented Jun 23, 2024

Thank you for posting this @gregwdata! I've been banging my head against the wall for the past week trying to figure out what was wrong.

@corytomlinson
Copy link

Unfortunately another instance where Azure OpenAI is not able to keep up parity with OpenAI. This kind of discrepancy makes it really tough to develop on Azure. It’s bad enough having to wait weeks for the new models.

@axiangcoding
Copy link

For my case, using openai = "^1.26.0" and langchain-openai = "0.1.8" would not be a problem. If anyone are using langchain you can rollback the version first to temp fix the problem

@corytomlinson
Copy link

For my case, using openai = "^1.26.0" and langchain-openai = "0.1.8" would not be a problem. If anyone are using langchain you can rollback the version first to temp fix the problem

Issue has nothing to do with OpenAI or Langchain. It is the Azure OpenAI API that is behind. There is no temp fix for this problem. It requires Microsoft to support the parameter in their API.

@adrianzartis
Copy link

I had the same issue. Downgrading from openai==1.35.7 to openai==1.34.0 solved the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants