Closed meliascosta closed 2 weeks ago
I'm also facing the same issue
It limits the usage of more than one tool with “required” tool choice Would it be updated in the coming versions?
should be fixed as of https://github.com/langchain-ai/langchain/pull/26599 which was released in langchain-openai 0.2.2. @meliascosta @prasanjeevi @kftam1994 let me know if you're still seeing issues!
Great! Thanks!
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".
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