mirror of
https://github.com/hwchase17/langchain.git
synced 2026-04-25 01:16:55 +00:00
docs(langchain): clarify create_tool_calling_agent system_prompt formatting and add troubleshooting (#33679)
This commit is contained in:
@@ -83,11 +83,15 @@ def create_tool_calling_agent(
|
||||
```
|
||||
|
||||
Prompt:
|
||||
|
||||
The agent prompt must have an `agent_scratchpad` key that is a
|
||||
`MessagesPlaceholder`. Intermediate agent actions and tool output
|
||||
messages will be passed in here.
|
||||
|
||||
Troubleshooting:
|
||||
- If you encounter `invalid_tool_calls` errors, ensure that your tool
|
||||
functions return properly formatted responses. Tool outputs should be
|
||||
serializable to JSON. For custom objects, implement proper __str__ or
|
||||
to_dict methods.
|
||||
"""
|
||||
missing_vars = {"agent_scratchpad"}.difference(
|
||||
prompt.input_variables + list(prompt.partial_variables),
|
||||
|
||||
Reference in New Issue
Block a user