TypedAIAgentSubgraphBuilderBase

abstract class TypedAIAgentSubgraphBuilderBase<Input : Any, Output : Any, SubgraphBuilder : TypedAIAgentSubgraphBuilderBase<Input, Output, SubgraphBuilder>>(name: String?, toolSelectionStrategy: ToolSelectionStrategy = ToolSelectionStrategy.ALL, llmModel: ERROR CLASS: Symbol not found for LLModel?? = null, llmParams: ERROR CLASS: Symbol not found for LLMParams?? = null, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor?? = null, inputClass: Class<Input>, outputOption: OutputOption<Output>, freshHistory: Boolean = false) : AgentSubgraphBuilder<SubgraphBuilder> (source)

A base class for constructing a typed AI agent subgraph builder with strongly defined input and output types. This class is designed for creating subgraphs within an AI agent graph structure, enabling the configuration of node interactions, tool usage, and the integration of language models (LLMs).

Type Parameters

Input

The type of the input data handled by the sub

Inheritors

Constructors

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

Functions

Link copied to clipboard
fun limitedTools(tools: List<ERROR CLASS: Symbol not found for ToolBase<*, *>>): SubgraphBuilder

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

fun limitedTools(vararg toolSets: ERROR CLASS: Symbol not found for ToolSet): SubgraphBuilder

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.

Link copied to clipboard
fun usingLLM(llmModel: ERROR CLASS: Symbol not found for LLModel): SubgraphBuilder

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

Link copied to clipboard

Configures the subgraph to start with only the parent's system messages, discarding inherited user/assistant conversation turns. The subgraph's own history is discarded upon completion, so it does not affect the parent's conversation.

Link copied to clipboard

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
fun withLLMParams(llmParams: ERROR CLASS: Symbol not found for LLMParams): SubgraphBuilder

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

Link copied to clipboard
fun withResponseProcessor(responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor): SubgraphBuilder

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.