Correct way to return tool output directly as agent response (skip agent LLM after tool call)? #5995
Unanswered
ivishalanand
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I’m building a custom agent with multiple tools (a bit like a React agent). For most tools, I want the agent LLM to take the tool’s output, reason further, and then respond.
But for one specific tool, once it generates a response, I want that response to be sent directly back to the user - without sending it back through the agent LLM for rewriting/paraphrasing.
I am not sure how to use
return_direct=True
to allow for this?Questions
1. What’s the recommended / idiomatic way in LangGraph to short-circuit tool outputs directly to the user?
2. Is there a built-in equivalent to the old return_direct=True from LangChain tools?
Beta Was this translation helpful? Give feedback.
All reactions