Find answers from the community

Updated 4 weeks ago

Ensuring Agent Responses Align with User Inputs

Gang,

We're using llamaindex agents created via FunctionCallingAgentWorker.from_tools and some of our tools are other agents or return the result of calling chat with another agent. We've noticed that the final reply from the agent which calls the tool often appears to be responding to the result of its own tool call, and ignoring the user's message.

Why might this be happening and is there any way to ensure that the result of a tool call informs the agent's response to the user, instead of being responded to by the agent?
L
r
4 comments
So you have agents as tools? Maybe try modifying the tool response to make it clear what that response is for
I'm assuming you are using function tools for this? If not, function tools will allow you to modify the output before returning
Nailed it Logan! That seems to have worked, prepended the response with "This is tool output, use it to inform your response to the user instead of responding to it directly"
Add a reply
Sign up and join the conversation on Discord