Skip to content

Commit 2d30ebb

Browse files
authored
docs(langchain): clarify create_tool_calling_agent system_prompt formatting and add troubleshooting (#33679)
1 parent b3934b9 commit 2d30ebb

File tree

1 file changed

+5
-1
lines changed
  • libs/langchain/langchain_classic/agents/tool_calling_agent

1 file changed

+5
-1
lines changed

libs/langchain/langchain_classic/agents/tool_calling_agent/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,15 @@ def magic_function(input: int) -> int:
8383
```
8484
8585
Prompt:
86-
8786
The agent prompt must have an `agent_scratchpad` key that is a
8887
`MessagesPlaceholder`. Intermediate agent actions and tool output
8988
messages will be passed in here.
9089
90+
Troubleshooting:
91+
- If you encounter `invalid_tool_calls` errors, ensure that your tool
92+
functions return properly formatted responses. Tool outputs should be
93+
serializable to JSON. For custom objects, implement proper __str__ or
94+
to_dict methods.
9195
"""
9296
missing_vars = {"agent_scratchpad"}.difference(
9397
prompt.input_variables + list(prompt.partial_variables),

0 commit comments

Comments
 (0)