Suppose I have some cleanup function which runs within on_tool_end(). It prints strings like “No cleanup needed”, “Position changed to x,y” etc. Is there any way to pass this output to an agent so it can craft the final response being aware of the changes done?
async def on_tool_end(self, context: RunContextWrapper, agent: Agent, tool: Tool, result: str) -> None:
print(f"\nTool '{tool.name}' result: {result[:1000]}...")
if tool.name == "my_agent_function_tool":
await hook_normalize(context)