AIAgentContext
Implements the AIAgentContext interface, providing the context required for an AI agent's execution. This class encapsulates configurations, the execution pipeline, agent environment, and tools for handling agent lifecycles and interactions.
Parameters
The AI agent environment responsible for tool execution and problem reporting.
The input message to be used for the agent's interaction with the environment.
The configuration settings of the AI agent.
The contextual data and execution utilities for the AI agent's interaction with LLMs.
Manages the internal state of the AI agent.
Concurrent-safe storage for managing key-value data across the agent's lifecycle.
The unique identifier for the agent session.
The identifier for the selected strategy in the agent's lifecycle.
The AI agent pipeline responsible for coordinating AI agent execution and processing.
Constructors
Creates an instance of the context with the given parameters.
Properties
KType representing the type of the agentInput
Represents the AI agent's LLM context, providing mechanisms for managing tools, prompts, and interaction with the execution environment. It ensures thread safety during concurrent read and write operations through the use of sessions.
Manages and tracks the state of aт AI agent within the context of its execution.
Concurrent-safe key-value storage for an agent, used to manage and persist data within the context of a the AI agent stage execution. The storage
property provides a thread-safe mechanism for sharing and storing data specific to the agent's operation.
Functions
Utility function to get AIAgentContextBase.agentInput and try to cast it to some expected type.
Creates a copy of the current AIAgentContext, allowing for selective overriding of its properties.
Creates a new instance of AIAgentContextBase with an updated list of tools, replacing the current tools in the LLM context with the provided list.
Retrieves a feature associated with the given key from the AI agent storage.
Retrieves an instance of the specified feature from the AI agent's storage.
Retrieves a feature of the specified type from the context or throws an exception if it is not available.
Creates a copy of the current AIAgentContext with deep copies of all mutable properties.
Retrieves data from the agent's storage using the specified key.
Retrieves the agent-specific context data associated with the current instance.
Retrieves the history of messages exchanged during the agent's execution.
Removes a feature or data associated with the specified key from the agent's storage.
Removes the agent-specific context data associated with the current context.
Replaces the current context with the provided context. This method is used to update the current context with values from another context, particularly useful in scenarios like parallel node execution where contexts need to be merged.
Stores a feature in the agent's storage using the specified key.
Stores the given agent context data within the current AI agent context.