Replies: 2 comments 3 replies
-
🤖 Hello @fgendre-u-iris! I'm a friendly bot, Dosu, here to assist you while we wait for a human maintainer. I specialize in solving bugs, answering questions, and helping users become contributors. So, feel free to ask anything related to the LangChain repository. 😊 Let's make your LangChain experience smoother together! Based on the current design of the LangChain framework, it seems that the agent's responses are tightly coupled with the execution of the tools. The agent's responses are constructed based on the intermediate steps of the tool execution, and there doesn't appear to be a built-in way to configure individual tools to not return any output after execution. However, you might be able to achieve this by modifying the def _construct_scratchpad(
self, intermediate_steps: List[Tuple[AgentAction, str]]
) -> str:
agent_scratchpad = super()._construct_scratchpad(intermediate_steps)
if not isinstance(agent_scratchpad, str):
raise ValueError("agent_scratchpad should be of type string.")
if agent_scratchpad:
# Check if the current tool should not return any output
if self.current_tool in tools_that_should_not_return_output:
return ""
else:
return (
f"This was your previous work "
f"(but I haven't seen any of it! I only see what "
f"you return as final answer):\n{agent_scratchpad}"
)
else:
return agent_scratchpad Please note that this is just a rough idea and might not work as expected without further modifications. Also, this would require you to maintain a list of tools that should not return any output ( I hope this helps! If you have any further questions or need more clarification, feel free to ask. SourcesThis response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
just i understand, the steps you want are:
what if it calls multiple tools and one of those is such a tool? |
Beta Was this translation helpful? Give feedback.
-
Hi
I need to be able to execute a certain tool with an agent, but i don't want the agent to give any answer to the request.
All i want is :
I can't use an empty "return direct" since i use a multi-action agent.
I don't want ALL of my tools to have that behavior, i wan't a classic agent usage with some tools that just don't return anything
Would love some help on this !
this is for langchain JS btw
Beta Was this translation helpful? Give feedback.
All reactions