FunctionalAgentBuilder

class FunctionalAgentBuilder<Input, Output>(strategy: AIAgentFunctionalStrategy<Input, Output>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: KoogClock = KoogClock.System, featureInstallers: MutableList<FunctionalAIAgent.FeatureContext.() -> Unit> = mutableListOf()) : AIAgentBuilderBase<FunctionalAgentBuilder<Input, Output>> (source)

A builder class for constructing instances of FunctionalAIAgent with customizable configuration.

This builder simplifies the configuration process by providing a fluent API to set various parameters for the FunctionalAIAgent, including its behavior strategy, prompt details, model settings, tool registry, and additional features. The builder enforces the presence of required configurations and allows the addition of optional parameters to tailor the agent's functionality.

Type Parameters

Input

The type of input that the resulting AI agent will process.

Output

The type of output that the resulting AI agent will produce.

Constructors

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

Functions

Link copied to clipboard

Configures the current builder instance using the provided AIAgentConfig.

Link copied to clipboard

Builds and returns an instance of AIAgent<Input, Output> based on the current configuration of the FunctionalAgentBuilder. This method ensures that all required fields are set, and applies any configured feature installers to the agent.

Link copied to clipboard

Sets the clock for the agent.

Link copied to clipboard

Sets the identifier for the builder configuration.

Link copied to clipboard

Installs and configures a given feature into the functional agent builder.

Link copied to clipboard

Sets the LLModel instance to be used by the builder.

Link copied to clipboard

Sets the maximum number of iterations for the builder.

Link copied to clipboard

Sets the number of choices to be utilized by the builder instance.

Link copied to clipboard

Sets the prompt to be used by the builder.

Link copied to clipboard

Sets the PromptExecutor to be used by the builder instance.

Link copied to clipboard

Sets the response processor for the agent.

Link copied to clipboard

Sets the system prompt to be used by the builder.

Link copied to clipboard

Sets the temperature value for the builder.

Link copied to clipboard

Sets the given ToolRegistry instance to the builder configuration.