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

A node that executes all tool calls in the assistant message and appends results as a user message.

Link copied to clipboard

Creates a new instance of CompressHistoryNodeBuilder with an optional custom name.

Link copied to clipboard
fun llmModerateMessage(name: String? = null, moderatingModel: ERROR CLASS: Symbol not found for LLModel??, includeCurrentPrompt: Boolean): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message, ModeratedMessage>

A node that moderates a message using the LLM.

Link copied to clipboard
fun llmRequest(name: String? = null): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Message.Assistant>

A node that sends a user message and requests a response from the LLM.

Link copied to clipboard
fun llmRequestForceOneTool(name: String? = null, tool: ERROR CLASS: Symbol not found for Tool<*, *>): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Message.Assistant>
fun llmRequestForceOneTool(name: String? = null, tool: ERROR CLASS: Symbol not found for ToolDescriptor): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Message.Assistant>

A node that sends a user message and requests a response from the LLM, forcing the LLM to call the specified tool.

Link copied to clipboard
fun llmRequestOnlyCallingTools(name: String? = null): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Message.Assistant>

A node that sends a user message and requests a response from the LLM, where only tool calls are allowed.

Link copied to clipboard
fun llmRequestStreaming(name: String? = null, structureDefinition: ERROR CLASS: Symbol not found for StructureDefinition??): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for StreamFrame>>

A node that sends a user message and requests a streaming response from the LLM.

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

Creates a node for streaming responses from LLM and handling the incoming stream data. This overload transforms the stream via a Publisher for Java interoperability.

Link copied to clipboard
fun <T : Any> llmRequestStructured(name: String? = null, config: ERROR CLASS: Symbol not found for StructuredRequestConfig<T>, fixingParser: ERROR CLASS: Symbol not found for StructureFixingParser??): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for StructuredResponse<T>>>

A node that sends a user message and requests a structured response from the LLM.

Link copied to clipboard
fun llmRequestWithoutTools(name: String? = null): AIAgentNodeBase<String, ERROR CLASS: Symbol not found for Message.Assistant>

A node that sends a user message and requests a response from the LLM without allowing tool calls.

Link copied to clipboard
fun llmSendMessage(name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Message.Assistant>

Creates and returns a node for the AI agent strategy graph that is responsible for sending a message.

Link copied to clipboard
fun llmSendMessageForceOneTool(name: String? = null, tool: ERROR CLASS: Symbol not found for Tool<*, *>): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Message.Assistant>
fun llmSendMessageForceOneTool(name: String? = null, tool: ERROR CLASS: Symbol not found for ToolDescriptor): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Message.Assistant>

A node that appends a Message.User to the prompt and requests a response from the LLM, forcing it to call exactly the specified tool.

Link copied to clipboard
fun llmSendMessageMultipleChoices(name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for LLMChoice>

A node that appends a Message.User to the prompt and requests multiple completion choices from the LLM, returning them as an LLMChoice.

Link copied to clipboard
fun llmSendMessageOnlyCallingTools(name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Message.Assistant>

A node that appends a Message.User to the prompt and requests a response from the LLM, forcing it to call one of the available tools (no plain-text replies allowed).

Link copied to clipboard
fun llmSendMessageStreaming(name: String? = null, structureDefinition: ERROR CLASS: Symbol not found for StructureDefinition??): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Flow<ERROR CLASS: Symbol not found for StreamFrame>>

A node that appends a Message.User to the prompt and requests a streaming response from the LLM, returning raw StreamFrame elements.

fun <T : Any> llmSendMessageStreaming(transformStreamData: (Flow.Publisher<ERROR CLASS: Symbol not found for StreamFrame>) -> Flow.Publisher<T>, outputClass: Class<T>, structureDefinition: ERROR CLASS: Symbol not found for StructureDefinition?? = null, name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, Flow.Publisher<T>>

A node that appends a Message.User to the prompt and requests a streaming response from the LLM. This overload transforms the stream via a Publisher for Java interoperability.

Link copied to clipboard
fun <T> llmSendMessageStructured(name: String? = null, config: ERROR CLASS: Symbol not found for StructuredRequestConfig<T>, fixingParser: ERROR CLASS: Symbol not found for StructureFixingParser??): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Result<ERROR CLASS: Symbol not found for StructuredResponse<T>>>

A node that appends a Message.User to the prompt and requests a structured response from the LLM.

Link copied to clipboard
fun llmSendMessageWithoutTools(name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for Message.User, ERROR CLASS: Symbol not found for Message.Assistant>

A node that appends a Message.User to the prompt and requests a response from the LLM, without exposing any tools (pure text response only).

Link copied to clipboard
fun llmSendToolResults(name: String? = null): AIAgentNodeBase<ReceivedToolResults, ERROR CLASS: Symbol not found for Message.Assistant>

A node that sends tool results as a message to the LLM.

Link copied to clipboard
fun selectLLMChoice(choiceSelectionStrategy: ChoiceSelectionStrategy, name: String? = null): AIAgentNodeBase<ERROR CLASS: Symbol not found for LLMChoice, ERROR CLASS: Symbol not found for Message.Assistant>

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