AIAgentLLMContext

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Parameters

tools

A list of tools described by ToolDescriptor that the agent can interact with.

toolRegistry

A registry of available tools, defaulting to an empty ToolRegistry.

prompt

The initial prompt used in the context, represented by a Prompt instance.

model

The language model used for processing prompts and generating responses.

responseProcessor

An optional ResponseProcessor for handling and processing model responses.

promptExecutor

Responsible for executing the logic for prompt processing in the context.

environment

The operational environment of the AI agent, represented by an AIAgentEnvironment.

config

Configuration settings for the AI agent, encapsulated in an AIAgentConfig.

clock

A clock instance for managing time-related operations within the context.

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Parameters

tools

A list of tools described by ToolDescriptor that the agent can interact with.

toolRegistry

A registry of available tools, defaulting to an empty ToolRegistry.

prompt

The initial prompt used in the context, represented by a Prompt instance.

model

The language model used for processing prompts and generating responses.

responseProcessor

An optional ResponseProcessor for handling and processing model responses.

promptExecutor

Responsible for executing the logic for prompt processing in the context.

environment

The operational environment of the AI agent, represented by an AIAgentEnvironment.

config

Configuration settings for the AI agent, encapsulated in an AIAgentConfig.

clock

A clock instance for managing time-related operations within the context.

Constructs a new instance of AIAgentLLMContext with the provided parameters.

Parameters

tools

A list of tools described by ToolDescriptor that the agent can interact with.

toolRegistry

A registry of available tools, defaulting to an empty ToolRegistry.

prompt

The initial prompt used in the context, represented by a Prompt instance.

model

The language model used for processing prompts and generating responses.

responseProcessor

An optional ResponseProcessor for handling and processing model responses.

promptExecutor

Responsible for executing the logic for prompt processing in the context.

environment

The operational environment of the AI agent, represented by an AIAgentEnvironment.

config

Configuration settings for the AI agent, encapsulated in an AIAgentConfig.

clock

A clock instance for managing time-related operations within the context.

Constructors

Link copied to clipboard
expect constructor(tools: List<ToolDescriptor>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, prompt: Prompt, model: LLModel, responseProcessor: ResponseProcessor?, promptExecutor: PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: Clock)
actual constructor(tools: List<ERROR CLASS: Symbol not found for ToolDescriptor>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, prompt: ERROR CLASS: Symbol not found for Prompt, model: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: ERROR CLASS: Symbol not found for Clock)
actual constructor(tools: List<ToolDescriptor>, toolRegistry: ToolRegistry, prompt: Prompt, model: LLModel, responseProcessor: ResponseProcessor?, promptExecutor: PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: Clock)

Properties

Link copied to clipboard
@get:JvmName(name = "clock")
val clock: Clock

Represents the clock instance used for time-related operations and scheduling within the context.

val clock: kotlin/time/Clock

Represents the clock instance used for time-related operations and scheduling within the context.

@get:JvmName(name = "clock")
val clock: Clock

Represents the clock instance used for time-related operations and scheduling within the context.

Link copied to clipboard
@get:JvmName(name = "config")
val config: AIAgentConfig

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

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

@get:JvmName(name = "config")
val config: AIAgentConfig

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

Link copied to clipboard
@get:JvmName(name = "environment")
val environment: AIAgentEnvironment

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

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

@get:JvmName(name = "environment")
val environment: AIAgentEnvironment

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.

var model: ai/koog/prompt/llm/LLModel

LLM currently associated with this context.

LLM currently associated with this context.

Link copied to clipboard
@get:JvmName(name = "prompt")
var prompt: Prompt

The current prompt used within the AIAgentLLMContext.

var prompt: ai/koog/prompt/dsl/Prompt

The current prompt used within the AIAgentLLMContext.

@get:JvmName(name = "prompt")
var prompt: Prompt

The current prompt used within the AIAgentLLMContext.

Link copied to clipboard

The PromptExecutor responsible for performing operations on the current prompt.

val promptExecutor: ai/koog/prompt/executor/model/PromptExecutor

The PromptExecutor responsible for performing operations on the current prompt.

The PromptExecutor responsible for performing operations on the current prompt.

Link copied to clipboard

Response processor currently associated with this context.

var responseProcessor: ai/koog/prompt/processor/ResponseProcessor??

Response processor currently associated with this context.

Response processor currently associated with this context.

Link copied to clipboard
@get:JvmName(name = "toolRegistry")
val toolRegistry: ToolRegistry

A ToolRegistry that contains metadata about available tools.

val toolRegistry: ai/koog/agents/core/tools/ToolRegistry

A ToolRegistry that contains metadata about available tools.

@get:JvmName(name = "toolRegistry")
val toolRegistry: ToolRegistry

A ToolRegistry that contains metadata about available tools.

Link copied to clipboard

List of current tools associated with this agent context.

var tools: List<ai/koog/agents/core/tools/ToolDescriptor>

List of current tools associated with this agent context.

List of current tools associated with this agent context.

Functions

Link copied to clipboard
open 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.

open 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.

open override fun copy(tools: List<ERROR CLASS: Symbol not found for ToolDescriptor>, prompt: ERROR CLASS: Symbol not found for Prompt, model: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: ERROR CLASS: Symbol not found for Clock): AIAgentLLMContext
open suspend override fun copy(tools: List<ERROR CLASS: Symbol not found for ToolDescriptor>, toolRegistry: ERROR CLASS: Symbol not found for ToolRegistry, prompt: ERROR CLASS: Symbol not found for Prompt, model: ERROR CLASS: Symbol not found for LLModel, responseProcessor: ERROR CLASS: Symbol not found for ResponseProcessor??, promptExecutor: ERROR CLASS: Symbol not found for PromptExecutor, environment: AIAgentEnvironment, config: AIAgentConfig, clock: ERROR CLASS: Symbol not found for Clock): AIAgentLLMContext

open fun copy(tools: List<ai/koog/agents/core/tools/ToolDescriptor> = this.tools, prompt: ai/koog/prompt/dsl/Prompt = this.prompt, model: ai/koog/prompt/llm/LLModel = this.model, responseProcessor: ai/koog/prompt/processor/ResponseProcessor?? = this.responseProcessor, promptExecutor: ai/koog/prompt/executor/model/PromptExecutor = this.promptExecutor, environment: AIAgentEnvironment = this.environment, config: AIAgentConfig = this.config, clock: kotlin/time/Clock = this.clock): AIAgentLLMContext

Returns the current prompt used in the LLM context.

open suspend fun copy(tools: List<ai/koog/agents/core/tools/ToolDescriptor> = this.tools, toolRegistry: ai/koog/agents/core/tools/ToolRegistry = this.toolRegistry, prompt: ai/koog/prompt/dsl/Prompt = this.prompt, model: ai/koog/prompt/llm/LLModel = this.model, responseProcessor: ai/koog/prompt/processor/ResponseProcessor?? = this.responseProcessor, promptExecutor: ai/koog/prompt/executor/model/PromptExecutor = this.promptExecutor, environment: AIAgentEnvironment = this.environment, config: AIAgentConfig = this.config, clock: kotlin/time/Clock = this.clock): AIAgentLLMContext

Creates a deep copy of this LLM context.

open 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.

open 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
open 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.

Executes a read-only session within the context of AIAgentLLMReadSession and returns the result of the provided block.

open 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.

open 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
open suspend fun withPrompt(block: Prompt.() -> Prompt)

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

open suspend fun withPrompt(block: ai/koog/prompt/dsl/Prompt.() -> ai/koog/prompt/dsl/Prompt)

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

open 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
open 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.

Executes a block of code within a write session for the AI Agent LLM context.

open 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.

open 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.