AgentBase
Defined in: src/agent/agent-base.ts:10
Interface defining the minimal contract for all agent types.
Both Agent (full orchestration agent) and A2AAgent (remote agent proxy)
implement this interface, enabling polymorphic usage across the SDK.
Properties
Section titled “Properties”readonly type: "agent";Defined in: src/agent/agent-base.ts:14
Type discriminator for identifying agent instances in union types.
readonly id: string;Defined in: src/agent/agent-base.ts:19
The unique identifier of the agent instance.
readonly optional name: string;Defined in: src/agent/agent-base.ts:24
The name of the agent.
description?
Section titled “description?”readonly optional description: string;Defined in: src/agent/agent-base.ts:29
Optional description of what the agent does.
Methods
Section titled “Methods”invoke()
Section titled “invoke()”invoke(args, options?): Promise<AgentResult>;Defined in: src/agent/agent-base.ts:38
Invokes the agent and returns the final result.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
args | InvokeArgs | Arguments for invoking the agent |
options? | InvokeOptions | Optional invocation options (e.g. structured output schema) |
Returns
Section titled “Returns”Promise<AgentResult>
Promise that resolves to the final AgentResult
stream()
Section titled “stream()”stream(args, options?): AsyncGenerator<AgentStreamEvent, AgentResult, undefined>;Defined in: src/agent/agent-base.ts:47
Streams the agent execution, yielding events and returning the final result.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
args | InvokeArgs | Arguments for invoking the agent |
options? | InvokeOptions | Optional invocation options (e.g. structured output schema) |
Returns
Section titled “Returns”AsyncGenerator<AgentStreamEvent, AgentResult, undefined>
Async generator that yields AgentStreamEvent objects and returns AgentResult