Skip to content

AI scenarios

Parallel tools

Bit.BlazorUI.AI Scripted transport

Two calls in flight at once, each with its own card, status, and timing.

Live demo

Compare two cities: the model asks for the weather in both at once.

Two calls in one round

Compare two cities
Ask a question to get started.

How it works

The transport asks for both calls in one response: two BitAiToolCallStartedEvents, each with its Arguments complete from the start - which makes the delta and completion events unnecessary - then BitAiFinishReason.ToolCalls. The session runs every call of the round concurrently, each through its own approval check, and waits for all of them before asking again; the transport then finds both results on the request and answers from them. Each card updates on its own, because each BitAiToolCallPart raises its own change event and only its own view re-renders - which is where a serial tool UI falls apart.

A declined or failed call does not stop the others. Its failure is recorded on that call and sent back to the model with the rest. BitAiChatSessionOptions.MaxToolRoundtrips caps how many rounds of tools one turn may take - ten by default, six for the sessions of this site, set with ai.ConfigureSessions. This page builds its session over a transport of its own, so it hands it those configured options (BitAiChatSessionFactory.Defaults) together with the tool registry. A model still asking for tools when the limit is reached gets no more: the reply ends with an error part saying the limit was hit.

Components used

Feedback

Found a mistake, a gap, or something that could be clearer? Every page and every component is one click from its source.