Interfaces

LlmRouter

Interface: LlmRouter

Defined in: src/patterns/LlmRouter.ts:170

A packaged routing decision-maker. Hold one per swarm.

Properties

id

readonly id: string

Defined in: src/patterns/LlmRouter.ts:172

Stable id (also the conditionalId on its route_decided events).


route

readonly route: (input) => string | undefined

Defined in: src/patterns/LlmRouter.ts:191

The sync seam swarm({ route }) wants. Returns the agent id decided FOR THAT EXACT message, or undefined (which halts the swarm) when no decision was recorded for it. Never calls an LLM, never guesses. Pre-bound — pass it directly as route.

Parameters

input
message

string

Returns

string | undefined


step

readonly step: Runner<{ message: string; }, string>

Defined in: src/patterns/LlmRouter.ts:184

The runner that MAKES a decision: one LLM call, parsed and validated. Returns the decision's message, so it drops into any chain that passes text along. Pre-bound — safe to pass around.


systemPrompt

readonly systemPrompt: string

Defined in: src/patterns/LlmRouter.ts:178

The compiled system prompt — the authored frame with the roster encoded inside it. Byte-stable for the same options, so you can diff it in a test or paste it in a bug report.

Methods

decisionFor()

decisionFor(message): RoutingDecision | undefined

Defined in: src/patterns/LlmRouter.ts:195

The decision recorded for a message, if there is one.

Parameters

message

string

Returns

RoutingDecision | undefined


decisions()

decisions(): readonly RoutingDecision[]

Defined in: src/patterns/LlmRouter.ts:193

Every decision this router has made, oldest first (recent window).

Returns

readonly RoutingDecision[]

On this page