-
Notifications
You must be signed in to change notification settings - Fork 75
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
tool_choice parameter does not match OpenAI API #78
Comments
This was referenced Mar 25, 2024
Gently bumping this, since there hasn't been a response from the maintainers, and this is a blocker for us in adopting / evaluating Mistral. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The the Mistral docs Azure AI page links to a notebook that shows that Mistral on Azure is compatible with the openai python package https://github.com/Azure/azureml-examples/blob/main/sdk/python/foundation-models/mistral/openaisdk.ipynb Do you also intend for the Mistral-hosted API to be compatible with the openai python package?
If so, the
tool_choice
parameter in the API and this package needs to be updated to support choosing a specific tool. According to the openai docs the allowed options fortool_choice
are"none"
,"auto"
, or{"type": "function", "function": {"name": "my_function"}}
.https://platform.openai.com/docs/api-reference/chat/create#chat-create-tool_choice
It appears that the Mistral API does not support the
{"type": "function", "function": {"name": "my_function"}}
format, returning errorThis package shows just the string options (with additional "any")
client-python/src/mistralai/models/chat_completion.py
Lines 34 to 39 in 80c7951
While the openai python package includes the option for a specific tool
https://github.com/openai/openai-python/blob/5cfb125acce0e8304d12bdd39b405071021db658/src/openai/types/chat/chat_completion_tool_choice_option_param.py#L12
Lack of support for tool_choice in the Mistral API makes it incompatible with the
openai
python package, which means tools like https://github.com/jackmpcollins/magentic have to add custom support for it.The text was updated successfully, but these errors were encountered: