@agorio/sdkDocs


Interface: SubAgent

A child agent that can be invoked from a parent ShoppingAgent via the built-in invoke_sub_agent tool, or composed sequentially via AgentChain.

Provide build (a factory) so each invocation gets a fresh agent with the parent’s tracer and onLog wrapped to inject parent_span_id and sub_agent_name attributes — the Cloud trace explorer uses these to render the multi-agent run as a tree.

Properties

build()

build: (ctx) => unknown

Factory invoked once per sub-agent run. Receives a build context with a pre-wrapped tracer / onLog that tag child spans and logs with parent metadata. Use these directly when constructing the child ShoppingAgent.

Parameters

ctx: SubAgentBuildContext

Returns

unknown

Defined in

src/types/index.ts:622


description

description: string

Description shown to the parent LLM when it invokes the sub-agent.

Defined in

src/types/index.ts:616


inputSchema?

optional inputSchema: Record<string, unknown>

Optional JSON Schema validated against the parent’s input argument.

Defined in

src/types/index.ts:624


name

name: string

Stable identifier used as the tool-call argument and span attribute.

Defined in

src/types/index.ts:614