Package-level declarations
Types
Represents the result of evaluating a specific condition in a system or workflow. This sealed interface allows for expressing various outcomes of a condition check.
Represents the result of a critique or feedback process.
Represents the result of a plan evaluation performed by an LLM (Large Language Model).
Represents the result of subgraphWithRetry.
Utility object providing tools and methods for working with subgraphs and tasks in a controlled and structured way. These utilities are designed to help finalize subgraph-related tasks and encapsulate result handling within tool constructs.
Properties
Functions
Creates and configures a ai.koog.agents.core.agent.entity.AIAgentGraphStrategy 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.
A method to utilize a language model (LLM) as a critic or judge for evaluating tasks with context-aware feedback. This method processes a given task and the interaction history to provide structured feedback on the task's correctness.
Creates a ReAct AI agent strategy that alternates between reasoning and execution stages to dynamically process tasks and request outputs from an LLM.
Configures a subgraph within the AI agent framework, associating it with required tasks and operations.
Defines a strategy for handling structured output with tools integration using specified configuration and execution logic.
Creates a subgraph with retry mechanism, allowing a specified action subgraph to be retried multiple times until a given condition is met or the maximum number of retries is reached.
Creates a subgraph that includes retry functionality based on a given condition and a maximum number of retries. If the condition is not met after the specified retries and strict mode is enabled, an exception is thrown. Unlike subgraphWithRetry, this function directly returns the output value instead of a RetrySubgraphResult.
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. The subgraph returns a wrapper SafeTool.Result to handle cases when the model didn't reach the finish condition or didn't generate a final ProvidedResult due to an error (reported as SafeTool.Result.Failure)
Creates a subgraph with a task definition and specified tools. The subgraph uses the provided tools to process input and execute the defined task, eventually producing a result through the provided finish tool.
Defines a subgraph with a specific task to be performed by an AI agent.
Creates a subgraph with a specified task definition, a list of tools, and a finish tool to transform output.
Creates a subgraph within an AI agent graph using a defined task, a tool selection strategy, and a finish tool function. This method provides the capability to integrate task-specific logic and tool selection into the AI agent's subgraph.
Defines a subgraph with a specific task in an AI agent graph, enabling the coordination of tools, task definitions, and execution logic.
subgraphWithTask with CriticResult result. It verifies if the task was performed correctly or not, and describes the problems if any.
Constructs a subgraph within an AI agent's strategy graph with additional verification capabilities.