Find answers from the community

Updated 3 days ago

Tools

Hello, Im trying out the AgentWorkflow feature and have noticed that the tool outputs arent being captured.

To start I've made a simple single agent AgentWorkflow. While the responses are generated, the response.tool_calls list is empty, and when listening to the stream of events, I never see the ToolCallResult being output.

My goal is to be able to get the source nodes used by the query engine tool. Not sure if its an issue or I have misunderstood something. Im following https://docs.llamaindex.ai/en/stable/understanding/agent/multi_agents/

See basic example below.

topic_a_agent = FunctionAgent(
name="topic_a_expert",
description="Answers questions about topic A",
system_prompt="You are a retrieval assistant.",
tools=[QueryEngineTool((....)]
llm=OpenAI(model="gpt-4"),
)


workflow = AgentWorkflow(
agents=[topic_a_agent], root_agent="topic_a_expert"
)

response = await workflow.run(user_msg="......")
L
g
7 comments
Yea this is a bug I've been meaning to fix πŸ˜… sadly I'm out for a week
The good news is that if you stream the events, you can pick up all the tool calls, as a workaround
Ah I see πŸ˜… no worries, thanks I will try this workaround in the mean time
On another note, is it possible to write an event to stream while a long running step is being executed to use as a keep alive?

e.g. 3 parallel query engine calls

I seem to be experiencing an issue where the http2 connection errors out with ERR_HTTP2_PROTOCOL_ERROR after a certain amount of time.
You can access the ctx in your tools and use ctx.send_event to send your own events
Just put the ctx as your first argument in a function and it'll get passed in

https://docs.llamaindex.ai/en/stable/examples/agent/agent_workflow_basic/#tools-and-state
Then you can define your own events to emit
Add a reply
Sign up and join the conversation on Discord