GitHub user pltbkd added a comment to the discussion: Parallel Tool Call 
Execution

Hi joeyutong,

Thanks for sharing the thoughts. I agree that executeAllAsync is a very useful 
addition, and I think the current proposal is a good direction. I just want to 
share another possible implementation approach for the parallel tool call 
scenario. The fan-out/fan-in flow could work as follows:

1. ChatModelAction can emit a ParallelToolRequestEvent when receiving a batch 
tool call request.
2. ToolCallAction can handle ParallelToolRequestEvent similarly to a normal 
tool request, and emit ParallelToolResponseEvent for each completed tool call.
3. A new ParallelToolCallSummarizer can subscribe to ParallelToolRequestEvent, 
maintain partial results in its state, and emit the final ToolCallResponse back 
to ChatModelAction once all results are available.

The overall flow would be similar to the parallel LLM example proposed recently 
by @Ryan-Nightwish.

Beyond tool calls, I think the fan-out/fan-in pattern may also be useful for 
other agent scenarios. For example, we could have parallel issue investigation, 
parallel data exploration, or parallel actions executed by multiple subagents, 
followed by a single final aggregation or notification step. These cases may 
naturally map to multiple independent actions with a final summarization/fan-in 
phase.

To be clear, I see this as an alternative approach rather than a replacement 
for executeAllAsync. I believe both of executeAllAsync and fan-in/out pattern 
will be useful. We can still introduce executeAllAsync as an independent 
capability for general parallel durable execution, regardless of whether the 
parallel tool call implementation chooses to use this pattern or not.

WDYT?


GitHub link: 
https://github.com/apache/flink-agents/discussions/855#discussioncomment-17593642

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to