GraphAgentBuilder

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

A builder class for creating instances of AIAgent. This builder provides a fluent interface to configure various parameters and components required to construct an AI agent with a specific set of features, tools, and execution strategies.

Parameters

strategy

The execution strategy used by the agent for processing input and generating results.

promptExecutor

PromptExecutor for the agent

id

id of the agent

config

AIAgentConfig containing initial agent configuration for the builder

clock

optional KoogClock to be used in the agent for calculating timestamps

Type Parameters

Input

The input type that the agent processes.

Output

The output type that the agent produces.

Constructors

Link copied to clipboard
constructor(strategy: AIAgentGraphStrategy<Input, Output>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: KoogClock = KoogClock.System, featureInstallers: MutableList<GraphAIAgent.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 configured using the parameters provided to the GraphAgentBuilder.

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 a new feature into the GraphAgentBuilder.

Installs a specified feature into the current context and applies its configuration.

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.