Package-level declarations

Types

Link copied to clipboard
class Koog(val application: Application, val promptExecutor: PromptExecutor, val agentConfig: KoogAgentsConfig.AgentConfig, val agentFeatures: List<GraphAIAgent.FeatureContext.() -> Unit>, job: CompletableJob)

Represents an instance of Koog with configuration for prompt execution, language model, tool management, agent setup, and features.

Link copied to clipboard

Configuration class for setting up a Koog agents server. Provides options to configure LLM connections, agent tools, features, and other related settings.

Link copied to clipboard

Configuration class for MCPTools that manages the integration of various tool registries into the system. Provides methods to process tools using different transport mechanisms.

Functions

Link copied to clipboard
suspend fun <Result> RoutingContext.aiAgent(runMode: ToolCalls = ToolCalls.SINGLE_RUN_SEQUENTIAL, model: LLModel, block: suspend (agent: AIAgent<String, String>) -> Result): Result

A default aiAgent is an agent that runs using singleRunStrategy, by default, it relies on sequential ToolCalls. Inside the block lambda you can use the agent to perform tasks, and calculate a result, such as GraphAIAgent.run.

inline suspend fun <Input, Output> RoutingContext.aiAgent(strategy: AIAgentGraphStrategy<Input, Output>, model: LLModel, input: Input): Output

Creates an agent using aiAgent, and immediately runs it given the input. When the agent is completed it provides the final Output.

inline suspend fun <Input, Output> RoutingContext.aiAgent(strategy: AIAgentGraphStrategy<Input, Output>, model: LLModel, tools: ToolRegistry = ToolRegistry.EMPTY): AIAgent<Input, Output>
inline suspend fun <Input, Output, Result> RoutingContext.aiAgent(strategy: AIAgentGraphStrategy<Input, Output>, model: LLModel, block: suspend (agent: AIAgent<Input, Output>) -> Result): Result
suspend fun <Input, Output> RoutingContext.aiAgent(inputType: KType, outputType: KType, strategy: AIAgentGraphStrategy<Input, Output>, model: LLModel, tools: ToolRegistry = ToolRegistry.EMPTY): AIAgent<Input, Output>

Creates an AI agent using the provided AI agent strategy within the specified route.

suspend fun RoutingContext.aiAgent(input: String, model: LLModel, runMode: ToolCalls = ToolCalls.SINGLE_RUN_SEQUENTIAL): String

A default aiAgent is an agent that runs using singleRunStrategy, by default, it relies on sequential ToolCalls. It takes an input, and when the agent finishes running provides a final result String.

Link copied to clipboard

Retrieve the configured llm, or PromptExecutor instance from the underlying Koog plugin.

Link copied to clipboard

Configures the MCP (Modular Configuration Protocol) tools for the agent with the provided configuration block.