Package-level declarations
Types
Represents a custom exception class for use in AI Agent-related processes.
Represents the execution context for an AI agent operating in a loop. It provides access to critical parts such as the environment, configuration, large language model (LLM) context, state management, and storage. Additionally, it enables the agent to store, retrieve, and manage context-specific data during its execution lifecycle.
A strategy for implementing AI agent behavior that operates in a loop-based manner.
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.f
Abstract base class for implementing an AI Agent Service. This class provides foundational functionality for managing and interacting with AI agents.
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.
Represents the core AI agent for processing input and generating output using a defined configuration, toolset, and prompt execution pipeline.
A service for managing functional AI agents that operate based on a specified execution strategy.
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.
A service class for managing graph-based AI agents, responsible for orchestrating the behavior and execution of agents within a configurable graph-based strategy.
Abstract base class representing a single-use AI agent with state.
Functions
Casts the current instance of a Message.Response to a Message.Assistant. This function should only be used when it is guaranteed that the instance is of type Message.Assistant, as it will throw an exception if the type does not match.
Attempts to cast a Message.Response
instance to a Message.Assistant
type.
Converts the current AI agent into a tool to allow using it in other agents as a tool.
Compresses the current LLM prompt (message history) into a summary, replacing messages with a TLDR.
Checks if the list of Message.Response
contains any instances of Message.Tool.Call
.
Executes multiple tool calls and returns their results. These calls can optionally be executed in parallel.
Calls a specific tool directly using the provided arguments.
Executes a tool call and returns the result.
Extracts a list of tool call messages from a given list of response messages.
Creates an AIAgentFunctionalStrategy with the specified loop logic and name.
Invokes the process to create and return an instance of GraphAIAgentService
.
Checks whether the AI agent has reached a finished state.
Retrieves the latest token usage from the prompt within the LLM session.
Executes the provided action if the given response is of type Message.Assistant.
Filters the provided list of response messages to include only assistant messages and, if the filtered list is not empty, performs the specified action with the filtered list.
Invokes the provided action when multiple tool call messages are found within a given list of response messages. Filters the list of responses to include only instances of Message.Tool.Call
and executes the action on the filtered list if it is not empty.
Sends a message to a Large Language Model (LLM) and optionally allows the use of tools during the LLM interaction. The message becomes part of the current prompt, and the LLM's response is processed accordingly, either with or without tool integrations based on the provided parameters.
Sends a message to a Large Language Model (LLM) and forces it to use a specific tool. The message becomes part of the current prompt, and the LLM is instructed to use only the specified tool.
Sends a message to a Large Language Model (LLM) and gets multiple LLM responses with tool calls enabled. The message becomes part of the current prompt, and multiple responses from the LLM are collected.
Sends a message to a Large Language Model (LLM) that will only call tools without generating text responses. The message becomes part of the current prompt, and the LLM is instructed to only use tools.
Sends a message to a Large Language Model (LLM) and streams the LLM response. The message becomes part of the current prompt, and the LLM's response is streamed as it's generated.
Sends a message to a Large Language Model (LLM) and requests structured data from the LLM with error correction capabilities. The message becomes part of the current prompt, and the LLM's response is processed to extract structured data.
Adds multiple tool results to the prompt and gets multiple LLM responses.
Adds a tool result to the prompt and requests an LLM response.
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: