createAgent

abstract suspend fun createAgent(id: String? = null, additionalToolRegistry: ToolRegistry = ToolRegistry.EMPTY, agentConfig: AIAgentConfig = this.agentConfig, clock: Clock = Clock.System): TAgent(source)

Creates a new AI agent with the specified configuration, tool registry, and optional parameters.

Return

The newly created AI agent.

Parameters

id

An optional unique identifier for the agent. If null, a default identifier will be generated.

additionalToolRegistry

The registry of tools to be used by the agent. Defaults to an empty registry.

agentConfig

The configuration settings for the AI agent. Defaults to the service's agent configuration.

clock

The clock instance to manage time-related operations, defaulting to the system clock.