AIAgentLLMContextAPI

Properties

Link copied to clipboard
abstract val clock: Clock

Represents the clock instance used for time-related operations and scheduling within the AIAgentLLMContextAPI. This property is intended for internal use in managing timing and scheduling functionalities across the LLM context.

Link copied to clipboard
abstract val config: AIAgentConfig

Provides access to the configuration settings for an AI agent within the LLM context.

Link copied to clipboard

Represents the execution environment associated with an AI agent within the context of the LLM (Large Language Model) framework.

Link copied to clipboard

LLM currently associated with this context.

Link copied to clipboard
abstract var prompt: Prompt

The current prompt used within the AIAgentLLMContext.

Link copied to clipboard

The PromptExecutor responsible for performing operations on the current prompt.

Link copied to clipboard

Response processor currently associated with this context.

Link copied to clipboard

A ToolRegistry that contains metadata about available tools.

Link copied to clipboard

List of current tools associated with this agent context.

Functions

Link copied to clipboard
abstract fun copy(tools: List<ToolDescriptor> = this.tools, prompt: Prompt = this.prompt, model: LLModel = this.model, responseProcessor: ResponseProcessor? = this.responseProcessor, promptExecutor: PromptExecutor = this.promptExecutor, environment: AIAgentEnvironment = this.environment, config: AIAgentConfig = this.config, clock: Clock = this.clock): AIAgentLLMContext

Returns the current prompt used in the LLM context.

abstract suspend fun copy(tools: List<ToolDescriptor> = this.tools, toolRegistry: ToolRegistry = this.toolRegistry, prompt: Prompt = this.prompt, model: LLModel = this.model, responseProcessor: ResponseProcessor? = this.responseProcessor, promptExecutor: PromptExecutor = this.promptExecutor, environment: AIAgentEnvironment = this.environment, config: AIAgentConfig = this.config, clock: Clock = this.clock): AIAgentLLMContext

Creates a deep copy of this LLM context.

Link copied to clipboard
abstract suspend fun <T> readSession(block: suspend AIAgentLLMReadSession.() -> T): T

Executes a read session within the AIAgentLLMContext, ensuring concurrent safety with active write session and other read sessions.

Link copied to clipboard
abstract suspend fun withPrompt(block: Prompt.() -> Prompt)

Updates the current AIAgentLLMContext with a new prompt and ensures thread-safe access using a read lock.

Link copied to clipboard
abstract suspend fun <T> writeSession(block: suspend AIAgentLLMWriteSession.() -> T): T

Executes a write session on the AIAgentLLMContext, ensuring that all active write and read sessions are completed before initiating the write session.