Package-level declarations

Types

Link copied to clipboard

The result which subgraphs can return.

Link copied to clipboard
@Serializable
data class StringSubgraphResult(val result: String) : SubgraphResult
Link copied to clipboard

The result which subgraphs can return.

Link copied to clipboard
@Serializable
data class VerifiedSubgraphResult(val correct: Boolean, val message: String) : SubgraphResult

Functions

Link copied to clipboard

Creates and configures a ai.koog.agents.core.agent.entity.AIAgentStrategy for executing a chat interaction process. The agent orchestrates interactions between different stages, nodes, and tools to handle user input, execute tools, and provide responses. Allows the agent to interact with the user in a chat-like manner.

Link copied to clipboard
fun simpleSingleRunAgent(executor: PromptExecutor, systemPrompt: String = "", llmModel: LLModel, temperature: Double = 1.0, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, maxIterations: Int = 50, installFeatures: AIAgent.FeatureContext.() -> Unit = {}): AIAgent

Creates and configures a AIAgent instance with a single-run strategy.

Link copied to clipboard

Creates a KotlinAgent instance configured to execute a sequence of operations for a single run process involving stages for sending an input, calling tools, and returning the final result.

Link copied to clipboard
fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithTask(toolSelectionStrategy: ToolSelectionStrategy, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, StringSubgraphResult>
fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithTask(tools: List<Tool<*, *>>, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, StringSubgraphResult>
fun <Input, ProvidedResult : SubgraphResult> AIAgentSubgraphBuilderBase<*, *>.subgraphWithTask(tools: List<Tool<*, *>>, finishTool: ProvideSubgraphResult<ProvidedResult>, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, ProvidedResult>

fun <Input, ProvidedResult : SubgraphResult> AIAgentSubgraphBuilderBase<*, *>.subgraphWithTask(toolSelectionStrategy: ToolSelectionStrategy, finishTool: ProvideSubgraphResult<ProvidedResult>, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, ProvidedResult>

Creates a subgraph, which performs one specific task, defined by defineTask, using the tools defined by toolSelectionStrategy. When LLM believes that the task is finished, it will call finishTool, generating ProvidedResult as its argument. The generated ProvidedResult is the result of this subgraph.

Link copied to clipboard
fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithVerification(toolSelectionStrategy: ToolSelectionStrategy, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, VerifiedSubgraphResult>

subgraphWithTask with VerifiedSubgraphResult result. It verifies if the task was performed correctly or not, and describes the problems if any.

fun <Input> AIAgentSubgraphBuilderBase<*, *>.subgraphWithVerification(tools: List<Tool<*, *>>, model: LLModel? = null, params: LLMParams? = null, shouldTLDRHistory: Boolean = true, defineTask: suspend AIAgentContextBase.(input: Input) -> String): AIAgentSubgraphDelegateBase<Input, VerifiedSubgraphResult>