GraphAgentBuilder

class GraphAgentBuilder<Input, Output>(strategy: AIAgentGraphStrategy<Input, Output>, inputType: TypeToken, outputType: TypeToken, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<GraphAIAgent.FeatureContext.() -> Unit> = mutableListOf())(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

Input

The input type that the agent processes.

Output

The output type that the agent produces.

strategy

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

inputType

The TypeToken representation of the input parameter type.

outputType

The TypeToken representation of the output parameter type.

promptExecutor

PromptExecutor for the agent

id

id of the agent

config

AIAgentConfig containing initial agent configuration for the builder

clock

optional Clock to be used in the agent for calculating timestamps

Constructors

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

Functions

Link copied to clipboard

Configures the GraphAgentBuilder using the provided AIAgentConfig instance.

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 unique identifier for the GraphAgentBuilder instance.

Link copied to clipboard

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

Link copied to clipboard

Sets the large language model (LLM) for the agent builder.

Link copied to clipboard

Sets the maximum number of iterations allowed for the agent's execution.

Link copied to clipboard

Sets the number of choices the agent can generate and returns the updated builder instance.

Link copied to clipboard

Sets the prompt for the GraphAgentBuilder and returns the builder instance for further configuration.

Link copied to clipboard

Sets the PromptExecutor instance to be used by this GraphAgentBuilder.

Link copied to clipboard

Sets the system-level prompt for the agent.

Link copied to clipboard

Sets the temperature parameter for the AI agent configuration.

Link copied to clipboard

Sets the toolRegistry for the GraphAgentBuilder and returns the updated builder instance.