Hey guys! I'm running a
routes/events.py
events generator to generate tool call events that are sent to the frontend with data about tool calls. I'm using
React Agent as chat engine
.
When I do anything that involves more than one tool - my system breaks. It seems to be stemming from the fact that no matter how many tools I call, the event data for the first tool called is the only one that gets sent,
""
8:[{"type": "events", "data": {"title": "Calling tool: recipe_lookup_thought with inputs: {'recipe_name': 'Carrot Cake'}"}}]
8:[{"type": "events", "data": {"title": "Calling tool: recipe_id_lookup_thought with inputs: {'recipe_id': 'bc495a05-bd5b-451e-bdfc-88eea3fccfe8'}"}}]
8:[{"type": "events", "data": {"title": "Calling tool: recipe_card_tool with inputs: {'recipeId': 'bc495a05-bd5b-451e-bdfc-88eea3fccfe8"}}]
0:" The"
8:[{"type": "tools", "data": {"toolOutput": {"output": "The recipeId for carrot cake is bc495a05-bd5b-451e-bdfc-88eea3fccfe8", "isError": false}, "toolCall": {"id": null, "name": "recipe_lookup_thought", "input": {"args": [], "kwargs": {"food_name": "CarrotCake"}}}}}]
0:" recipe"
0:" for"
However my desired outcome is to have several lines of
8: tool type events
- has anyone faced this issue before? Any tips on how to get more granular control over the react agent flow beside modifying the react prompt template?