Skip to content

agents / 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
NameType
configIAgentConfig
Returns

void | Promise<void>

Defined in

packages/agents/src/managers/agent-factory.ts:45


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
NameType
agentIAgent<IAgentConfig, IRunOptions, TUniversalMessage>
configIAgentConfig
Returns

void | Promise<void>

Defined in

packages/agents/src/managers/agent-factory.ts:47


onCreateError

Optional onCreateError: (error: Error, config: IAgentConfig) => void | Promise<void>

Called when agent creation fails

Type declaration

▸ (error, config): void | Promise<void>

Parameters
NameType
errorError
configIAgentConfig
Returns

void | Promise<void>

Defined in

packages/agents/src/managers/agent-factory.ts:49


onDestroy

Optional onDestroy: (agentId: string) => void | Promise<void>

Called when agent is destroyed

Type declaration

▸ (agentId): void | Promise<void>

Parameters
NameType
agentIdstring
Returns

void | Promise<void>

Defined in

packages/agents/src/managers/agent-factory.ts:51

Released under the MIT License.