DefinedAIAgentSubgraphBuilder

class DefinedAIAgentSubgraphBuilder<Input : Any, Output : Any>(name: String?, toolSelectionStrategy: ToolSelectionStrategy = ToolSelectionStrategy.ALL, llmModel: LLModel? = null, llmParams: LLMParams? = null, responseProcessor: ResponseProcessor? = null, inputClass: ERROR CLASS: Symbol not found for Class<Input>, outputClass: ERROR CLASS: Symbol not found for Class<Output>, buildSubgraph: GraphBuilderAction<Input, Output>) : TypedAIAgentSubgraphBuilderBase<Input, Output, TypedAIAgentSubgraphBuilder<Input, Output>> (source)

Builder class for creating a defined AI Agent subgraph with specific input and output types.

This class allows customization of subgraph configurations, such as the selection strategy for tools, language model parameters, and response processing. The subgraph's internal logic is defined using the buildSubgraph action passed to the constructor.

Parameters

Input

The type of the input data for the subgraph.

Output

The type of the output data for the subgraph.

name

The name of the subgraph.

toolSelectionStrategy

Strategy to determine which tools are included in this subgraph. Defaults to using all tools.

llmModel

The Large Language Model (LLM) to use for generating responses, or null if no model is provided.

llmParams

Optional parameters for configuring the behavior of the LLM, such as temperature or context length.

responseProcessor

A processor for handling and modifying the response after the subgraph's execution.

inputClass

The class representing the input type for the subgraph.

outputClass

The class representing the output type for the subgraph.

buildSubgraph

The action that defines the logic for constructing the subgraph.

Constructors

Link copied to clipboard
constructor(name: String?, toolSelectionStrategy: ToolSelectionStrategy = ToolSelectionStrategy.ALL, llmModel: LLModel? = null, llmParams: LLMParams? = null, responseProcessor: ResponseProcessor? = null, inputClass: ERROR CLASS: Symbol not found for Class<Input>, outputClass: ERROR CLASS: Symbol not found for Class<Output>, buildSubgraph: GraphBuilderAction<Input, Output>)

Initializes the builder with a name, tool selection strategy, LLM configuration, response processor, input/output types, and a subgraph build action.

Functions

Link copied to clipboard

Builds and returns an instance of AIAgentSubgraphBase configured with the specified input and output types.

Link copied to clipboard
fun limitedTools(vararg toolSets: ERROR CLASS: Symbol not found for ToolSet): TypedAIAgentSubgraphBuilder<Input, Output>

Configures the builder with a selection of tools defined by the provided tool sets. The tools will be extracted from each ToolSet and applied to the builder's tool selection strategy.

Configures the builder to use a specific list of tools for the AI agent's subgraph.

Link copied to clipboard

Sets the specified Large Language Model (LLM) for the agent subgraph builder.

Link copied to clipboard
fun <Input : Any> withInput(outputClass: ERROR CLASS: Symbol not found for Class<Input>): AIAgentSubgraphBuilderWithInput<Input, *>

Configures the builder with the specified input type and returns a new instance of AIAgentSubgraphBuilderWithInput, allowing further configuration for the specified input type.

Link copied to clipboard

Sets the parameters for the Language Learning Model (LLM) in the current builder.

Link copied to clipboard

Sets the specified response processor to handle and modify LLM responses.

Link copied to clipboard

Sets the tool selection strategy for the subgraph builder and returns the updated builder instance.