tool_choice='required' is now supported by Azure but blocked in langchain #25864
Closed
5 tasks done
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
investigate
Flagged for investigation.
Checked other resources
Example Code
In line 662 here: https://github.com/langchain-ai/langchain/blob/master/libs/partners/openai/langchain_openai/chat_models/azure.py#L662
we can see that tool_choice = 'required' is explicitly filtered out
and a note in a comment saying:
# As of 05/2024 Azure OpenAI doesn't support tool_choice="required".
# TODO: Update this condition once tool_choice="required" is supported.
It is now supported in the preview API from July https://learn.microsoft.com/en-us/rest/api/azureopenai/operation-groups?view=rest-azureopenai-2024-07-01-preview&preserve-view=true
Error Message and Stack Trace (if applicable)
ValueError("Azure OpenAI does not currently support tool_choice='required'. Should be one of 'auto', 'none', or the name of the tool to call.")
Description
I would like to use the setting
System Info
System Information
Package Information
Other Dependencies
The text was updated successfully, but these errors were encountered: