Package-level declarations

Types

Link copied to clipboard
expect abstract class AIAgent<Input, Output> : Closeable

Represents a basic interface for AI agent.

actual abstract class AIAgent<Input, Output> : <ERROR CLASS> ERROR CLASS: Symbol not found for Closeable

Represents a basic interface for AI agent.

actual abstract class AIAgent<Input, Output> : Closeable

Represents a basic interface for AI agent.

Link copied to clipboard
abstract class AIAgentBase<Input, Output, TContext : AIAgentContext>(logger: KLogger, id: String? = null) : AIAgent<Input, Output>

Abstract base class representing a single-use AI agent with state.

Link copied to clipboard

Represents a configurational builder for setting up and customizing the execution parameters and components of an AI agent. This builder enables fine-grained control over tools, strategies, and prompts utilized by an AI agent during its execution.

Represents a configurational builder for setting up and customizing the execution parameters and components of an AI agent. This builder enables fine-grained control over tools, strategies, and prompts utilized by an AI agent during its execution.

Represents a configurational builder for setting up and customizing the execution parameters and components of an AI agent. This builder enables fine-grained control over tools, strategies, and prompts utilized by an AI agent during its execution.

Link copied to clipboard

Shared fluent configuration for agent builders.

Link copied to clipboard

Common chained implementation for AIAgentBuilder actual classes.

Link copied to clipboard

A strategy for implementing AI agent behavior that operates in a loop-based manner.

Link copied to clipboard
expect abstract class AIAgentService<Input, Output, TAgent : AIAgent<Input, Output>>

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

actual abstract class AIAgentService<Input, Output, TAgent : AIAgent<Input, Output>>

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

actual abstract class AIAgentService<Input, Output, TAgent : AIAgent<Input, Output>>

AIAgentService is a core interface for managing AI agents. The service allows creation, removal, and management of AI agents and provides functionalities to list agents based on their statuses.

Link copied to clipboard

Abstract base class for implementing an AI Agent Service. This class provides foundational functionality for managing and interacting with AI agents.

Link copied to clipboard

Builder for creating AIAgentService instances.

Builder for creating AIAgentService instances.

Builder for creating AIAgentService instances.

Link copied to clipboard

Shared fluent configuration for agent service builders.

Link copied to clipboard

Common chained implementation for AIAgentServiceBuilder actual classes.

Link copied to clipboard
sealed interface AIAgentState<Output>

Represents the state of an AI agent during its lifecycle.

Link copied to clipboard
class AIAgentTool<Input, Output>(agentService: AIAgentService<Input, Output, *>, agentName: String, agentDescription: String, inputDescription: String? = null, inputType: TypeToken, outputType: TypeToken, parentAgentId: String? = null) : Tool<AIAgentTool.AgentToolInput<Input>, AIAgentTool.AgentToolResult<Output>>

AIAgentTool is a generic tool that wraps an AI agent to facilitate integration with the context of a tool execution framework. It enables the serialization, deserialization, and execution of an AI agent's operations.

Link copied to clipboard

Provides functionality to generate diagram representations of AI agent strategies configured as graphs. Implementations of this interface are responsible for translating an AIAgentGraphStrategy into a textual or visual format suitable for understanding and visualization of agent workflows.

Link copied to clipboard
class FunctionalAgentBuilder<Input, Output>(strategy: AIAgentFunctionalStrategy<Input, Output>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<FunctionalAIAgent.FeatureContext.() -> Unit> = mutableListOf()) : AIAgentBuilderBase<FunctionalAgentBuilder<Input, Output>>

A builder class for constructing instances of FunctionalAIAgent with customizable configuration.

Link copied to clipboard

A builder class for constructing a FunctionalAIAgentService, enabling a fluent configuration style.

Link copied to clipboard
class FunctionalAIAgent<Input, Output>(val promptExecutor: PromptExecutor, val agentConfig: AIAgentConfig, val strategy: AIAgentFunctionalStrategy<Input, Output>, val toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, val clock: Clock = Clock.System, val installFeatures: FunctionalAIAgent.FeatureContext.() -> Unit = {}) : AIAgentBase<Input, Output, AIAgentFunctionalContext>

Represents the core AI agent for processing input and generating output using a defined configuration, toolset, and prompt execution pipeline.

Link copied to clipboard

A service for managing functional AI agents that operate based on a specified execution strategy.

Link copied to clipboard
class GraphAgentBuilder<Input, Output>(strategy: AIAgentGraphStrategy<Input, Output>, inputType: TypeToken, outputType: TypeToken, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<GraphAIAgent.FeatureContext.() -> Unit> = mutableListOf()) : AIAgentBuilderBase<GraphAgentBuilder<Input, Output>>

A builder class for creating instances of AIAgent. This builder provides a fluent interface to configure various parameters and components required to construct an AI agent with a specific set of features, tools, and execution strategies.

Link copied to clipboard

A builder class for constructing a GraphAIAgentService with configurable properties such as prompt executor, model, tool registry, prompts, and various other configurations.

Link copied to clipboard
open class GraphAIAgent<Input, Output>(val inputType: TypeToken, val outputType: TypeToken, val promptExecutor: PromptExecutor, val agentConfig: AIAgentConfig, val strategy: AIAgentGraphStrategy<Input, Output>, val toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, val clock: Clock = Clock.System, val installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}) : AIAgentBase<Input, Output, AIAgentGraphContextBase>

Represents an implementation of an AI agent that provides functionalities to execute prompts, manage tools, handle agent pipelines, and interact with various configurable strategies and features.

Link copied to clipboard
class GraphAIAgentService<Input, Output>(val promptExecutor: PromptExecutor, val agentConfig: AIAgentConfig, val strategy: AIAgentGraphStrategy<Input, Output>, inputType: TypeToken, outputType: TypeToken, val toolRegistry: ToolRegistry, val installFeatures: GraphAIAgent.FeatureContext.() -> Unit) : AIAgentServiceBase<Input, Output, GraphAIAgent<Input, Output>>

A service class for managing graph-based AI agents, responsible for orchestrating the behavior and execution of agents within a configurable graph-based strategy.

Link copied to clipboard
Link copied to clipboard
sealed interface OutputOption<Output : Any>

Represents a configuration option for determining the output type in a subtask builder process. This sealed interface allows specifying the output either by its class type or by using a tool that generates the required output.

Link copied to clipboard
class PlannerAgentBuilder<Input, Output>(strategy: AIAgentPlannerStrategy<Input, Output, *>, promptExecutor: PromptExecutor? = null, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, config: AIAgentConfig, clock: Clock = Clock.System, featureInstallers: MutableList<PlannerAIAgent.FeatureContext.() -> Unit> = mutableListOf()) : AIAgentBuilderBase<PlannerAgentBuilder<Input, Output>>

Builds an AI-based planning agent by configuring various parameters and defining custom behaviors for the agent. This builder allows flexible setup of an agent's functionality and behavior based on the provided configuration and tools.

Link copied to clipboard

Enum representing the modes in which a single-run strategy for an AI agent can be executed.

Functions

Link copied to clipboard

Extension function to generate a Mermaid diagram from an agent graph strategy.

Link copied to clipboard
inline fun <Input, Output> AIAgent<Input, Output>.asTool(agentName: String, agentDescription: String, inputDescription: String? = null, inputSerializer: KSerializer<Input> = serializer(), outputSerializer: KSerializer<Output> = serializer(), json: Json = Json.Default): Tool<AIAgentTool.AgentToolInput<Input>, AIAgentTool.AgentToolResult<Output>>

Converts the current AI agent into a tool to allow using it in other agents as a tool.

Link copied to clipboard
inline fun <Input, Output> AIAgentService<Input, Output, *>.createAgentTool(agentName: String, agentDescription: String, inputDescription: String? = null, inputType: TypeToken = typeToken<Input>(), outputType: TypeToken = typeToken<Output>(), parentAgentId: String? = null, clock: Clock = Clock.System): Tool<AIAgentTool.AgentToolInput<Input>, AIAgentTool.AgentToolResult<Output>>
inline fun <Input, Output> AIAgentService<Input, Output, *>.createAgentTool(agentName: String, agentDescription: String, inputDescription: String? = null, inputSerializer: KSerializer<Input>, outputSerializer: KSerializer<Output>, parentAgentId: String? = null, clock: Clock = Clock.System): Tool<AIAgentTool.AgentToolInput<Input>, AIAgentTool.AgentToolResult<Output>>

Creates an AIAgent and converts it to a Tool that can be used by other AI Agents.

Link copied to clipboard

Creates an AIAgentFunctionalStrategy with the specified loop logic and name.

Link copied to clipboard
operator fun AIAgentService.Companion.invoke(promptExecutor: PromptExecutor, agentConfig: AIAgentConfig, strategy: AIAgentGraphStrategy<String, String> = singleRunStrategy(), toolRegistry: ToolRegistry = ToolRegistry.EMPTY, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgentService<String, String>

Invokes the process to create and return an instance of GraphAIAgentService.

Link copied to clipboard

Creates a single-run strategy for an AI agent. This strategy defines a simple execution flow where the agent processes input, calls tools, and sends results back to the agent. The flow consists of the following steps: