GraphAIAgent

constructor(inputType: TypeToken, outputType: TypeToken, promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {})(source)

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

Parameters

id

Unique identifier for the agent. Random UUID will be generated if set to null.

Type Parameters

Input

Type of agent input.

Output

Type of agent output.


constructor(inputType: KType, outputType: KType, promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {})(source)

Deprecated

Use constructor with `TypeToken` instead of `KType`.

Secondary constructor for initializing a GraphAIAgent with KType parameters.

Parameters

inputType

Represents the input type of the agent as a KType.

outputType

Represents the output type of the agent as a KType.

promptExecutor

The PromptExecutor responsible for processing LLM prompts within the agent.

agentConfig

The configuration settings for the AI agent, including prompts, models, and execution limits.

strategy

The graph strategy for handling input/output transformations during agent execution.

toolRegistry

A registry of tools available for use by the agent, defaulting to an empty registry.

id

An optional identifier for the agent, allowing for multiple agents with unique IDs.

clock

Clock instance used by the agent, defaulting to the system clock.

installFeatures

A lambda for installing custom features in the agent's feature context.