AIAgentNodeBase

Represents an abstract node in an AI agent strategy graph, responsible for executing a specific operation and managing directed edges to other nodes.

Parameters

Input

The type of input data this node processes.

Output

The type of output data this node produces.

Inheritors

Types

Link copied to clipboard
data class ResolvedEdge(val edge: AIAgentEdge<*, *>, val output: Any?)

Represents a resolved edge in the context of an AI agent strategy graph, combining an edge and its corresponding resolved output.

Properties

Link copied to clipboard

Represents the directed edges connecting the current node in the AI agent strategy graph to other nodes. Each edge defines the flow and transformation of output data from this node to another.

Link copied to clipboard
abstract val name: String

Functions

Link copied to clipboard
open fun addEdge(edge: AIAgentEdge<Output, *>)

Adds a directed edge from the current node, enabling connections between this node and other nodes in the AI agent strategy graph.

Link copied to clipboard
abstract suspend fun execute(context: AIAgentContextBase, input: Input): Output

Executes a specific operation based on the given context and input.

Link copied to clipboard

Resolves the edge associated with the provided node output and execution context. Iterates through available edges and identifies the first edge that can successfully process the given node output within the provided context. If a resolvable edge is found, it returns a ResolvedEdge containing the edge and its output. Otherwise, returns null.