Find answers from the community

Updated last year

llama_index/llama_index/agent/react/outp...

At a glance

The community member is experiencing an intermittent exception raised by /agent/react/step.py when the message_content contains "Thought:". The issue seems to be related to the code in https://github.com/run-llama/llama_index/blob/main/llama_index/agent/react/output_parser.py#L101 as it doesn't enter any of the if cases. Another community member suggests that the agent should return the response instead of exiting when the "Thought" message is something like "I need to provide a definition for <question>". However, the first community member notes that this works fine when the "Thought" message is something like "I need to use a tool...". The second community member responds that they don't think there is a way to do that currently, but they are willing to review and merge community PRs.

Useful resources
Hello, I'm getting an intermittent exception raised by /agent/react/step.py for this message_content: Thought: blah blah.
it seems to be raised by https://github.com/run-llama/llama_index/blob/main/llama_index/agent/react/output_parser.py#L101 because it doesn't enter any of the if cases. any idea how we can handle the case when message_content contains Thought:?
s
L
3 comments
@Logan M it works fine if the Thought message is something like "I need to use a tool..." but if the Thought message is something like "I need to provide a definition for <question asked>" then it exits from the exception. Is there a way for the agent to just return the response in that case instead of exiting?
I don't think there is a way to do that currently. But if you are up for it, I'm always willing to review/merge community PRs ❤️
Thank you for always being responsive to questions! Really appreciate it!
Add a reply
Sign up and join the conversation on Discord