Replies: 1 comment
-
🤖 Hi, Based on the information you've provided, it seems like the issue might be related to how the agent's responses are processed. The LangChain framework and OpenAI do not inherently cause this issue. The issue could be in the part of the code where the agent's responses are processed. If the agent's responses are not being properly sanitized to remove or replace the tool names, they might appear in the final output. In the context shared, the You could add a sanitization step in your pipeline to ensure tool names are not mentioned in the agent's responses. Here's a simple example of how you might do this: def sanitize_response(response, tool_names):
for tool_name in tool_names:
response = response.replace(tool_name, '')
return response
# Use the function in your pipeline
response = sanitize_response(agent_response, tool_names) This function takes the agent's response and a list of tool names as input, and returns the response with all occurrences of the tool names removed. You would need to call this function before outputting the agent's response. The LangChain framework handles the processing of agent responses through the use of an output parser. This is evident in the The output parser is responsible for parsing the output of the agent. If a custom output parser is not provided when constructing an agent from an LLM and tools, the default output parser ( This shows that the LangChain framework handles the processing of agent responses by parsing the output of the agent using the specified or default output parser. I hope this helps! If you have any other questions or need further clarification, feel free to ask. Best, Sources
This 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I have created a chatbot pipeline using langchain and OpenAI using the following schema:
I have 4 different tools, which take in information from different SQL tables or textual data sources and return the information.
In the prompt template that I pass to the agent, I have explicitly mentioned:
Never mention the name of the tool or table you are using.
But still when getting an answer after using a tool, the agent mentions the name of the tool which was used.
Any idea what can be the case here?
Beta Was this translation helpful? Give feedback.
All reactions