LlmCore.Agent.ToolDispatch.Components.CollectResults (llm_core v0.3.0)

Copy Markdown View Source

Composer that collects parallel execution results back into a single event.

Accumulates step_result from each fanned-out event in its memo. When all expected results have been collected (count matches total_parallel), emits a single event with all parallel_results populated.

If the event was NOT fanned out (no parallel steps), it passes through.

ALF Composer Contract

Returns {events, memo}. Emits nothing until all parallel results are collected, then emits one composed event and resets memo.

IMPORTANT: This Composer must have count: 1 (the default) to ensure all fanned-out events reach the same worker for proper accumulation.

Summary

Functions

Collection function for the ALF Composer.

Functions

call(event, memo, opts)

Collection function for the ALF Composer.

Parameters

  • event%Event{} with step_result from parallel execution
  • memo — List of accumulated results
  • opts — ALF composer options (unused)

Returns

{[Event.t()], [map()]} — Empty list while collecting, single event when all results are gathered.