Extracts tool calls from the LLM response.
If the response contains no tool calls (or an empty list), sets
decision to {:done, response} — the LLM has produced a final text
response and no further iteration is needed.
If tool calls are present, populates ctx.tool_calls for downstream
stages.
When ctx.terminal_tool is set and a matching call is present, the
pipeline marks the response as done and stores the matching call and raw
arguments on the context. The call is not validated, dispatched, or injected
into the next turn.
Analogous to a context merge stage: takes raw input and normalizes it into the pipeline's working format.
Summary
Functions
Extracts tool calls from ctx.response.tool_calls.
Functions
@spec call( LlmCore.Agent.Context.t(), keyword() ) :: LlmCore.Agent.Context.t()
Extracts tool calls from ctx.response.tool_calls.
Short-circuits when ctx.status is :error.
Parameters
ctx—%Context{}with the LLM responseopts— ALF stage options (unused)
Returns
Updated %Context{} with either:
tool_callspopulated and pipeline continues, ordecision: {:done, response}when no tool calls are presentdecision: {:done, response}plus terminal fields when the terminal tool is called