You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current documentation example for tools uses an invalid tool_choice format ({"type": "tool", "name": "greet"}) that doesn't work. After debugging, I found the correct format should follow the OpenAI-style function calling specification ({"type": "function", "function": {"name": "greet"}}). This discrepancy causes runtime errors and confusion for users.
My LangGraph Version: 0.4.8
Langchain Version: 0.3.25
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
The problem I discovered while learning LangGraph.
documentation: https://langchain-ai.github.io/langgraph/agents/tools/#force-tool-use
The current documentation example for tools uses an invalid tool_choice format ({"type": "tool", "name": "greet"}) that doesn't work. After debugging, I found the correct format should follow the OpenAI-style function calling specification ({"type": "function", "function": {"name": "greet"}}). This discrepancy causes runtime errors and confusion for users.
My LangGraph Version: 0.4.8
Langchain Version: 0.3.25
run code errors:
Working Solution:
Expected Behavior:
Documentation examples should show the correct tool_choice format that matches the underlying LLM API expectations.
Beta Was this translation helpful? Give feedback.
All reactions