Package-level declarations

Types

Link copied to clipboard

AIAgentEnvironment provides a mechanism for AI agents to interface with an external environment. It offers methods for tool execution, error reporting, and sending termination messages.

Link copied to clipboard

Represents an AI agent environment that operates within the context of a specific agent framework.

Link copied to clipboard
class GenericAgentEnvironment(agentId: String, logger: KLogger, toolRegistry: ToolRegistry, serializer: JSONSerializer) : AIAgentEnvironment

Represents base agent environment with generic abstractions.

Link copied to clipboard
data class ReceivedToolResult(val id: String?, val tool: String, val toolArgs: JSONObject, val toolDescription: String?, val content: String, val resultKind: ToolResultKind, val result: JSONElement?)

Represents the result or response received from a tool operation.

Link copied to clipboard
data class SafeTool<TArgs, TResult>(tool: Tool<TArgs, TResult>, environment: AIAgentEnvironment, clock: Clock)

A wrapper class designed to safely execute a tool within a given AI agent environment. It provides mechanisms for handling tool execution results and differentiating between success and failure cases.

Link copied to clipboard

Provides constants related to the termination tool functionality in an AI agent environment.

Link copied to clipboard

Represents the possible result types for a tool operation.

Functions

Link copied to clipboard
suspend fun <TResult> SafeTool<ERROR CLASS: Symbol not found for ToolFromCallable.Args, TResult>.executeUnsafe(serializer: ERROR CLASS: Symbol not found for JSONSerializer, vararg args: Any?): SafeTool.Result<TResult>

Helper function for SafeTool that is created from ToolFromCallable. Allows a simpler execution by passing the ToolFromCallable.callable positional arguments directly as args instead of creating ToolFromCallable.Args manually.

Link copied to clipboard

Adds a tool result to the prompt.

Link copied to clipboard
fun <TResult> ReceivedToolResult.toSafeResult(tool: Tool<*, TResult>, serializer: JSONSerializer): SafeTool.Result<TResult>

Converts a ReceivedToolResult instance into a SafeTool.Result for safer result handling.