AIAgent

constructor(executor: PromptExecutor, llmModel: LLModel, strategy: AIAgentStrategy = singleRunStrategy(), systemPrompt: String = "", temperature: Double = 1.0, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, maxIterations: Int = 50, installFeatures: AIAgent.FeatureContext.() -> Unit = {})(source)

Creates an instance of AIAgent with the specified parameters.

Parameters

executor

The PromptExecutor responsible for executing prompts.

strategy

The AIAgentStrategy defining the agent's behavior. Default is a single-run strategy.

systemPrompt

The system-level prompt context for the agent. Default is an empty string.

llmModel

The language model to be used by the agent.

temperature

The sampling temperature for the language model, controlling randomness. Default is 1.0.

toolRegistry

The ToolRegistry containing tools available to the agent. Default is an empty registry.

maxIterations

Maximum number of iterations for the agent's execution. Default is 50.

installFeatures

A suspending lambda to install additional features for the agent's functionality. Default is an empty lambda.


constructor(promptExecutor: PromptExecutor, strategy: AIAgentStrategy, agentConfig: AIAgentConfigBase, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, clock: Clock = Clock.System, installFeatures: AIAgent.FeatureContext.() -> Unit = {})(source)

Initializes the AI agent instance and prepares the feature context and pipeline for use.