AIAgent

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

Creates a GraphAIAgent with the given graph strategy and configuration.

Return

A GraphAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

agentConfig

Configuration for the agent, including the prompt, model, and other parameters.

strategy

Graph strategy defining the agent's workflow.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.


fun AIAgent(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgent<String, String>(source)

Creates a GraphAIAgent with the default singleRunStrategy and the given configuration.

Return

A GraphAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

agentConfig

Configuration for the agent, including the prompt, model, and other parameters.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.


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

Creates a FunctionalAIAgent with the given functional strategy and configuration.

Return

A FunctionalAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

agentConfig

Configuration for the agent, including the prompt, model, and other parameters.

strategy

Functional strategy defining the agent's execution logic.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.


fun <Input, Output> AIAgent(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentPlannerStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit = {}): PlannerAIAgent<Input, Output>(source)

Creates a PlannerAIAgent with the given planner strategy and configuration.

Return

A PlannerAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

agentConfig

Configuration for the agent, including the prompt, model, and other parameters.

strategy

Planner strategy defining the agent's workflow.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.


fun <Input, Output> AIAgent(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgent<Input, Output>(source)

Creates a GraphAIAgent with the given graph strategy and model parameters.

Return

A GraphAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

strategy

Graph strategy defining the agent's workflow.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.


fun AIAgent(promptExecutor: PromptExecutor, llmModel: LLModel, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgent<String, String>(source)

Creates a GraphAIAgent with the default singleRunStrategy and the given model parameters.

Return

A GraphAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.


fun <Input, Output> AIAgent(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentFunctionalStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}): FunctionalAIAgent<Input, Output>(source)

Creates a FunctionalAIAgent with the given functional strategy and model parameters.

Return

A FunctionalAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

strategy

Functional strategy defining the agent's execution logic.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.


fun <Input, Output> AIAgent(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentPlannerStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, systemPrompt: String? = null, temperature: Double? = null, maxIterations: Int = 50, responseProcessor: ResponseProcessor? = null, id: String? = null, clock: KoogClock = KoogClock.System, installFeatures: PlannerAIAgent.FeatureContext.() -> Unit = {}): PlannerAIAgent<Input, Output>(source)

Creates a PlannerAIAgent with the given planner strategy and model parameters.

Return

A PlannerAIAgent instance configured with the provided parameters.

Parameters

promptExecutor

Executor responsible for processing prompts and interacting with the language model.

llmModel

Language model to use.

strategy

Planner strategy defining the agent's workflow.

toolRegistry

Registry of tools available to the agent. Defaults to an empty registry.

systemPrompt

Optional system prompt for the agent.

temperature

Optional sampling temperature for the model, typically between 0.0 and 1.0.

maxIterations

Maximum number of agent iterations. Defaults to 50.

responseProcessor

Optional processor for the model's responses.

id

Unique identifier for the agent. A random UUID is used if null.

clock

Clock for time-related operations. Defaults to KoogClock.System.

installFeatures

Lambda to install additional features into the agent's feature context.

Type Parameters

Input

The type of input the agent processes.

Output

The type of output the agent produces.