agent-core / Exports / IAgentLifecycleEvents
Interface: IAgentLifecycleEvents
Agent lifecycle events
Table of contents
Properties
Properties
beforeCreate
• Optional beforeCreate: (config: IAgentConfig) => void | Promise<void>
Called before agent creation
Type declaration
▸ (config): void | Promise<void>
Parameters
| Name | Type |
|---|---|
config | IAgentConfig |
Returns
void | Promise<void>
Defined in
packages/agent-core/src/managers/agent-factory.ts:50
afterCreate
• Optional afterCreate: (agent: IAgent<IAgentConfig, IRunOptions, TUniversalMessage>, config: IAgentConfig) => void | Promise<void>
Called after successful agent creation
Type declaration
▸ (agent, config): void | Promise<void>
Parameters
| Name | Type |
|---|---|
agent | IAgent<IAgentConfig, IRunOptions, TUniversalMessage> |
config | IAgentConfig |
Returns
void | Promise<void>
Defined in
packages/agent-core/src/managers/agent-factory.ts:52
onCreateError
• Optional onCreateError: (error: Error, config: IAgentConfig) => void | Promise<void>
Called when agent creation fails
Type declaration
▸ (error, config): void | Promise<void>
Parameters
| Name | Type |
|---|---|
error | Error |
config | IAgentConfig |
Returns
void | Promise<void>
Defined in
packages/agent-core/src/managers/agent-factory.ts:54
onDestroy
• Optional onDestroy: (agentId: string) => void | Promise<void>
Called when agent is destroyed
Type declaration
▸ (agentId): void | Promise<void>
Parameters
| Name | Type |
|---|---|
agentId | string |
Returns
void | Promise<void>