Companion

Companion object for the AIAgentNode class.

Functions

Link copied to clipboard
fun builder(name: String? = null): AIAgentNodeBuilder

Creates and returns a new instance of AIAgentNodeBuilder, used for constructing and configuring instances of AIAgentNode.

Link copied to clipboard
fun <T : Any> doNothing(clazz: ERROR CLASS: Symbol not found for Class<T>, name: String? = null): AIAgentNode<T, T>

A utility method that performs no modifications or operations on its input and simply returns it as output. Useful as a pass-through or identity transformation.

Link copied to clipboard

Executes multiple tools as part of an AI agent's processing node.

Link copied to clipboard

Executes multiple tools and sends their aggregated results as responses.

Link copied to clipboard

Executes a tool and returns an AI agent node configured for tool execution.

Link copied to clipboard

Creates a new instance of CompressHistoryNodeBuilder with an optional custom name. If no name is specified, a default name will be generated using the current node counter.

Link copied to clipboard
fun llmModerateMessage(moderatingModel: LLModel? = null, includeCurrentPrompt: Boolean = false, name: String? = null): AIAgentNodeBase<Message, ModeratedMessage>

Creates an AI agent node for moderating messages using a specified language model.

Link copied to clipboard
fun llmRequest(allowToolCalls: Boolean = true, name: String? = null): AIAgentNodeBase<String, Message.Response>

Creates an AI agent node for handling language model requests.

Link copied to clipboard

Creates an AI agent node that processes a language model request while forcefully utilizing a specific tool.

Creates an AI agent node that forces the execution of a single specified tool during the handling of a language model request.

Link copied to clipboard

Creates an AI agent node that processes multiple responses from a language model request.

Link copied to clipboard

Creates an AI agent node designed to handle language model requests where only tool calls are executed, and multiple responses are returned.

Link copied to clipboard

Creates an AI agent node that processes language model requests while exclusively enabling tool calls during execution.

Link copied to clipboard
fun llmRequestStreaming(structureDefinition: StructureDefinition? = null, name: String? = null): AIAgentNodeBase<String, Flow<StreamFrame>>

Creates an AI agent node configured for processing streaming requests to a language model.

fun <T : Any> llmRequestStreaming(transformStreamData: (ERROR CLASS: Symbol not found for Publisher<ai/koog/prompt/streaming/StreamFrame>) -> ERROR CLASS: Symbol not found for Publisher<T>, outputClass: ERROR CLASS: Symbol not found for Class<T>, structureDefinition: StructureDefinition? = null, name: String? = null): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Publisher<T>>

Creates a node for streaming responses from LLM and handling the incoming stream data. The method allows customization of the transformation applied to the streamed frames and is designed for integration in Java environments.

Link copied to clipboard

Sends a structured request to a language model and returns a corresponding response node.

Link copied to clipboard

Creates an AI agent node that forces the use of a specified tool during the handling of a language model request.

Creates an AI agent node for handling a language model request that forcibly uses a single tool.

Link copied to clipboard

Creates an AI agent node configured to handle language model requests that only involve tool calls. This method is deprecated and replaced by llmRequestOnlyCallingTools.

Link copied to clipboard

Creates an AI agent node for sending multiple tool results to a language model.

Creates an AI agent node designed to process multiple tool result responses while restricting interactions to only the tools that were explicitly invoked. This is useful for controlled scenarios where tool response management is confined to specific tools.

Link copied to clipboard

A node that sends multiple tool execution results to the LLM and gets multiple LLM choices.

Link copied to clipboard

Creates an AI agent node for sending a single tool result to the language model.

Link copied to clipboard

Creates an AI agent node that processes a list of tool execution results and generates a response, limited to nodes that make tool calls during execution.

Link copied to clipboard
fun selectLLMChoice(choiceSelectionStrategy: ChoiceSelectionStrategy, name: String? = null): AIAgentNodeBase<List<LLMChoice>, LLMChoice>

A node that chooses an LLM choice based on the given strategy.