# `LlmCore.Agent.ToolDispatch.Components.CollectResults`
[🔗](https://github.com/fosferon/llm_core/blob/v0.3.0/lib/llm_core/agent/tool_dispatch/components/collect_results.ex#L1)

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.

# `call`

```elixir
@spec call(LlmCore.Agent.ToolDispatch.Event.t(), [map()], keyword()) ::
  {[LlmCore.Agent.ToolDispatch.Event.t()], [map()]}
```

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.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
