ChatToolCallsComponent

ChatToolCallsComponent renders all tool calls associated with an assistant message. By default sequential same-name calls auto-group into a labeled strip; consumers can register per-tool-name templates via the chatToolCallTemplate directive to fully replace the default card UX.

Selector: chat-tool-calls

Import:

import { ChatToolCallsComponent } from '@ngaf/chat';

#Inputs

InputTypeDefaultDescription
[agent]Agent— (required)Source of agent.toolCalls()
[message]Message | undefinedundefinedFilter to calls referenced by this message's tool_use content blocks
[grouping]'auto' | 'none''auto'Auto-collapse adjacent same-name calls into a strip
[groupSummary](name: string, count: number) => stringbuilt-in registryOverride the default strip label

#Default group summaries

Tool name shapeDefault label
search_*"Searched N sites"
generate_*"Generated N items"
read_*"Read N files"
write_*"Wrote N files"
list_*"Listed N items"
Anything else"Called N times"

#Per-tool templates

Register a template per tool name (or "*" as a wildcard) — see chat-tool-call-template.

<chat-tool-calls [agent]="agent" [message]="msg">
  <ng-template chatToolCallTemplate="search_web" let-call let-status="status">
    <my-search-result-card [query]="call.args.query" [results]="call.result" />
  </ng-template>
</chat-tool-calls>

When a per-tool template is registered for a name, calls of that name skip grouping and are rendered each through the template (the consumer takes responsibility for visual density).

#Custom group summary

<chat-tool-calls
  [agent]="agent"
  [message]="msg"
  [groupSummary]="myGroupSummary"
/>
myGroupSummary = (name: string, count: number) =>
  name === 'fetch_user' ? `Fetched ${count} profiles` : `${name} × ${count}`;

#Disabling grouping

<chat-tool-calls [agent]="agent" [message]="msg" [grouping]="'none'" />

Each call renders independently regardless of name adjacency.