Companion

The companion object for the AIAgent class, providing functionality to instantiate an AI agent with a flexible configuration, input/output types, and execution strategy.

Types

Link copied to clipboard
sealed interface State<Output>

Represents the state of an AI agent during its lifecycle.

Functions

Link copied to clipboard
operator fun invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(), toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<String, String>

Operator function to create and invoke an AI agent with the given parameters.

operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): FunctionalAIAgent<Input, Output>

Creates a functional AI agent with the provided configurations and execution strategy.

inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>

Creates an instance of an AI agent based on the provided configuration, input/output types, and execution strategy.

operator fun invoke(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(), toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, systemPrompt: String = "", temperature: Double = 1.0, numberOfChoices: Int = 1, maxIterations: Int = 50, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<String, String>

Construction of an AI agent with the specified configurations and parameters.

operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, strategy: AIAgentFunctionalStrategy<Input, Output>, id: String? = null, systemPrompt: String = "", temperature: Double = 1.0, numberOfChoices: Int = 1, maxIterations: Int = 50, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>

Creates an FunctionalAIAgent with the specified parameters to execute a strategy with the assistance of a tool registry, configured language model, and associated features.

inline operator fun <Input, Output> invoke(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, systemPrompt: String = "", temperature: Double = 1.0, numberOfChoices: Int = 1, maxIterations: Int = 50, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): AIAgent<Input, Output>

Creates and configures an AI agent using the provided parameters.