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.
Methods
Section titled “Methods”invoke()
Section titled “invoke()”invoke(args, options?): Promise<AgentResult>;Defined in: src/agent/agent-base.ts:18
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:27
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