Class: BaseAgent<TConfig, TContext, TMessage>
Base abstract class for all agents with type parameter support Provides common structure and lifecycle management
Type parameters
| Name | Type | Description |
|---|---|---|
TConfig | AgentConfig | Agent configuration type (defaults to AgentConfig for backward compatibility) |
TContext | RunOptions | Execution context type (defaults to RunOptions for backward compatibility) |
TMessage | Message | Message type (defaults to Message for backward compatibility) |
Hierarchy
BaseAgent↳
Robota
Implements
BaseAgentInterface<TConfig,TContext,TMessage>
Table of contents
Constructors
Methods
Constructors
constructor
• new BaseAgent<TConfig, TContext, TMessage>(): BaseAgent<TConfig, TContext, TMessage>
Type parameters
| Name | Type |
|---|---|
TConfig | AgentConfig |
TContext | RunOptions |
TMessage | Message |
Returns
BaseAgent<TConfig, TContext, TMessage>
Methods
configure
▸ configure(config): Promise<void>
Configure the agent with type-safe configuration
Parameters
| Name | Type |
|---|---|
config | TConfig |
Returns
Promise<void>
Implementation of
BaseAgentInterface.configure
Defined in
packages/agents/src/abstracts/base-agent.ts:28
run
▸ run(input, context?): Promise<string>
Run agent with user input and type-safe context
Parameters
| Name | Type |
|---|---|
input | string |
context? | TContext |
Returns
Promise<string>
Implementation of
BaseAgentInterface.run
Defined in
packages/agents/src/abstracts/base-agent.ts:36
runStream
▸ runStream(input, context?): AsyncGenerator<string, void, never>
Run agent with streaming response and type-safe context
Parameters
| Name | Type |
|---|---|
input | string |
context? | TContext |
Returns
AsyncGenerator<string, void, never>
Implementation of
BaseAgentInterface.runStream
Defined in
packages/agents/src/abstracts/base-agent.ts:41
getHistory
▸ getHistory(): TMessage[]
Get conversation history with type-safe messages
Returns
TMessage[]
Implementation of
BaseAgentInterface.getHistory
Defined in
packages/agents/src/abstracts/base-agent.ts:46
clearHistory
▸ clearHistory(): void
Clear conversation history
Returns
void
Implementation of
BaseAgentInterface.clearHistory
Defined in
packages/agents/src/abstracts/base-agent.ts:53
dispose
▸ dispose(): Promise<void>
Cleanup resources
Returns
Promise<void>