diff --git a/libs/partners/fireworks/langchain_fireworks/chat_models.py b/libs/partners/fireworks/langchain_fireworks/chat_models.py index 9b9a06d5181..a07398f6d35 100644 --- a/libs/partners/fireworks/langchain_fireworks/chat_models.py +++ b/libs/partners/fireworks/langchain_fireworks/chat_models.py @@ -721,19 +721,6 @@ class ChatFireworks(BaseChatModel): tool_choice not in ("auto", "any", "none") ): tool_choice = {"type": "function", "function": {"name": tool_choice}} - if isinstance(tool_choice, dict) and (len(formatted_tools) != 1): - raise ValueError( - "When specifying `tool_choice`, you must provide exactly one " - f"tool. Received {len(formatted_tools)} tools." - ) - if isinstance(tool_choice, dict) and ( - formatted_tools[0]["function"]["name"] - != tool_choice["function"]["name"] - ): - raise ValueError( - f"Tool choice {tool_choice} was specified, but the only " - f"provided tool was {formatted_tools[0]['function']['name']}." - ) if isinstance(tool_choice, bool): if len(tools) > 1: raise ValueError(