Package-level declarations

Types

Link copied to clipboard
class AgentContextData(messageHistory: List<Message>, nodePath: String, lastInput: JSONElement? = null, lastOutput: JSONElement? = null, rollbackStrategy: RollbackStrategy, additionalRollbackActions: suspend (AIAgentContext) -> Unit = {})
Link copied to clipboard
interface AIAgentContext

The AIAgentContext interface represents the context of an AI agent in the lifecycle. It provides access to the environment, configuration, LLM context, state management, storage, and other metadata necessary for the operation of the agent. Additionally, it supports features for custom workflows and extensibility.

Link copied to clipboard
class AIAgentFunctionalContext(environment: AIAgentEnvironment, agentId: String, runId: String, agentInput: Any?, config: AIAgentConfig, llm: AIAgentLLMContext, stateManager: AIAgentStateManager, storage: AIAgentStorage, strategyName: String, pipeline: AIAgentFunctionalPipeline, executionInfo: AgentExecutionInfo, parentContext: AIAgentContext? = null) : AIAgentFunctionalContextBase<AIAgentFunctionalPipeline>

Represents the context for an AI agent of FunctionalAIAgent type, serving as the execution environment and state holder while an agent operates within a predefined pipeline. It extends AIAgentFunctionalContextBase and is designed to allow configuration, state management, and storage for an agent's functional operations.

Link copied to clipboard

Base class for functional/planner context implementations across all targets.

Base class for functional/planner context implementations across all targets.

Base class for functional/planner context implementations across all targets.

Link copied to clipboard

Base AIAgentContext implementation providing functionality common across platforms

Link copied to clipboard
class AIAgentGraphContext(environment: AIAgentEnvironment, val agentId: String, val agentInputType: TypeToken, val agentInput: Any?, val config: AIAgentConfig, llm: AIAgentLLMContext, stateManager: AIAgentStateManager, storage: AIAgentStorage, val runId: String, val strategyName: String, val pipeline: AIAgentGraphPipeline, executionInfo: AgentExecutionInfo, val parentContext: AIAgentGraphContextBase?) : AIAgentGraphContextBase

Implements the AIAgentGraphContext interface, providing the context required for an AI agent's execution. This class encapsulates configurations, the execution pipeline, agent environment, and tools for handling agent lifecycles and interactions.

Link copied to clipboard

The AIAgentGraphContextBase interface extends the AIAgentContextBase interface to provide a foundational context specifically tailored for AI agents operating within a graph structure.

Link copied to clipboard

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Link copied to clipboard

Common AIAgentLLMContext implementation shared across platforms.

Link copied to clipboard
class AIAgentPlannerContext(environment: AIAgentEnvironment, agentId: String, runId: String, agentInput: Any?, config: AIAgentConfig, llm: AIAgentLLMContext, stateManager: AIAgentStateManager, storage: AIAgentStorage, strategyName: String, pipeline: AIAgentPlannerPipeline, executionInfo: AgentExecutionInfo, parentContext: AIAgentContext? = null) : AIAgentFunctionalContextBase<AIAgentPlannerPipeline>

Represents a context for the AI agent of PlannerAIAgent type, responsible for managing execution pipelines, configurations, and other contextual data required for agent operations.

Link copied to clipboard
annotation class DetachedPromptExecutorAPI

Annotation for marking APIs as detached prompt executors within the AIAgentLLMContext.

Link copied to clipboard
Link copied to clipboard
class SubtaskBuilder(val context: AIAgentFunctionalContextBase<*>, val taskDescription: String)

A builder class responsible for creating and managing subtasks within the context of an AI agent's functional operations.

Link copied to clipboard
class SubtaskBuilderWithOutput<Output : Any>(val context: AIAgentFunctionalContextBase<*>, val taskDescription: String, val output: OutputOption<Output>, var tools: List<ERROR CLASS: Symbol not found for Tool<*, *>>? = null, var llmModel: ERROR CLASS: Symbol not found for LLModel?? = null, var llmParams: ERROR CLASS: Symbol not found for LLMParams?? = null, var responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor?? = null, var runMode: ToolCalls = ToolCalls.SEQUENTIAL, var assistantResponseRepeatMax: Int? = null, var executorService: ExecutorService? = null)

Builder class to create and configure a subtask with specified input and output types.

Properties

Link copied to clipboard

A storage key used for associating and retrieving AgentContextData within the AI agent's storage system.

Functions

Link copied to clipboard
inline fun <T> AIAgentContext.agentInput(): T

Utility function to get AIAgentContext.agentInput and try to cast it to some expected type.

Link copied to clipboard

Retrieves a feature from the AIAgentContext.pipeline associated with this context using the specified key.

Link copied to clipboard

Retrieves a feature from the AIAgentContext.pipeline associated with this context using the specified key or throws an exception if it is not available.

Link copied to clipboard

Retrieves the agent-specific context data associated with the current instance.

Link copied to clipboard

Removes the agent-specific context data associated with the current context.

Link copied to clipboard

Provides the root context of the current agent. If the root context is not defined, this function defaults to returning the current instance.

Link copied to clipboard

Stores the given agent context data within the current AI agent context.

Link copied to clipboard
inline fun <T> AIAgentContext.with(executionInfo: AgentExecutionInfo, block: (executionInfo: AgentExecutionInfo, eventId: String) -> T): T

Executes a block of code with a modified execution context.

inline fun <T> AIAgentContext.with(partName: String, block: (executionInfo: AgentExecutionInfo, eventId: String) -> T): T

Executes a block of code with a modified execution context, creating a parent-child relationship between execution contexts for tracing purposes.