PlannerAgentBuilder

class PlannerAgentBuilder<Input, Output>(strategy: AIAgentPlannerStrategy<Input, Output, *>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<PlannerAIAgent.FeatureContext.() -> Unit> = mutableListOf())(source)

Builds an AI-based planning agent by configuring various parameters and defining custom behaviors for the agent. This builder allows flexible setup of an agent's functionality and behavior based on the provided configuration and tools.

Parameters

State

The type representing the state handled by the AI agent.

strategy

The planning strategy used by the agent to process and execute tasks.

promptExecutor

The executor responsible for handling AI prompts.

toolRegistry

The registry of tools available for use by the agent. Defaults to an empty tool registry.

id

The optional identifier of the agent.

config

AIAgentConfig containing initial agent configuration for the builder

clock

The clock instance used to track time-related operations for the agent. Defaults to the system clock.

featureInstallers

A list of feature installers that enhance the agent's behavior with additional functionality.

Constructors

Link copied to clipboard
constructor(strategy: AIAgentPlannerStrategy<Input, Output, *>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<PlannerAIAgent.FeatureContext.() -> Unit> = mutableListOf())

Functions

Link copied to clipboard

Configures the agent with the specified AI agent configuration.

Link copied to clipboard

Constructs and returns an instance of AIAgent configured with the provided parameters and features.

Link copied to clipboard

Sets the identifier for the PlannerAgentBuilder and returns the updated builder instance.

Link copied to clipboard

Installs a functional feature into the PlannerAgentBuilder with the specified configuration.

Link copied to clipboard

Sets the Large Language Model (LLM) to be used by the PlannerAgentBuilder.

Link copied to clipboard

Sets the maximum number of iterations for the planner agent.

Link copied to clipboard

Sets the number of choices the planner agent can consider while making decisions.

Link copied to clipboard

Sets the prompt to be used by the builder and updates the internal state accordingly.

Link copied to clipboard

Sets the PromptExecutor instance to be used by the PlannerAgentBuilder.

Link copied to clipboard

Configures the system prompt for the planner agent.

Link copied to clipboard

Sets the temperature parameter for the planner agent. Temperature controls the randomness of the agent's outputs. A higher value encourages more random and diverse outputs, while a lower value makes the outputs more focused and deterministic.

Link copied to clipboard

Sets the tool registry for the PlannerAgentBuilder.