DelegatingAIAgent class abstract

Abstract base class for AI agents that delegate operations to an inner agent while allowing extensibility via the decorator pattern.

Inheritance
Implementers
Available extensions

Constructors

DelegatingAIAgent(AIAgent innerAgent)
Creates a DelegatingAIAgent wrapping innerAgent.

Properties

debuggerDisplay String
no setterinherited
description String?
Gets a description of the agent's purpose and capabilities.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
id String
Gets the unique identifier for this agent instance.
no setterinherited
idCore String?
A custom identifier for the agent, which derived classes can override.
no setterinherited
innerAgent AIAgent
The underlying agent that receives delegated operations.
final
name String?
Gets the human-readable name of the agent.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asAIFunction({AIFunctionFactoryOptions? options, AgentSession? session}) → AIFunction

Available on AIAgent, provided by the AIAgentExtensions extension

Creates an AIFunction that runs this AIAgent.
asBuilder() AIAgentBuilder

Available on AIAgent, provided by the AIAgentExtensions extension

Creates a new AIAgentBuilder using this agent as the pipeline root.
createSession({CancellationToken? cancellationToken}) Future<AgentSession>
Creates a new conversation session compatible with this agent.
inherited
createSessionCore({CancellationToken? cancellationToken}) Future<AgentSession>
Core implementation of session creation logic.
override
deserializeSession(dynamic serializedState, {Object? jsonSerializerOptions, CancellationToken? cancellationToken}) Future<AgentSession>
Deserializes an agent session from a previously serialized state.
inherited
deserializeSessionCore(dynamic serializedState, {Object? jsonSerializerOptions, CancellationToken? cancellationToken}) Future<AgentSession>
Core implementation of session deserialization.
override
evaluate(Iterable<String> queries, String evalName, Iterable<String>? expectedOutput, Iterable<Iterable<ExpectedToolCall>>? expectedToolCalls, CancellationToken cancellationToken, {AgentEvaluator? evaluator, ConversationSplitter? splitter, int? numRepetitions, ChatConfiguration? chatConfiguration, Iterable<AgentEvaluator>? evaluators, Iterable<AgentResponse>? responses}) Future<AgentEvaluationResults>

Available on AIAgent, provided by the AgentEvaluationExtensions extension

Evaluates an agent by running it against test queries and scoring the responses.
evaluateWithMeai(Iterable<String> queries, String evalName, Evaluator evaluator, ChatConfiguration chatConfiguration, {Iterable<String>? expectedOutput, Iterable<Iterable<ExpectedToolCall>>? expectedToolCalls, ConversationSplitter? splitter, int? numRepetitions, CancellationToken? cancellationToken}) Future<AgentEvaluationResults>

Available on AIAgent, provided by the AgentEvaluationExtensions extension

Wraps an MEAI Evaluator and evaluates this agent with it.
getService(Type serviceType, {Object? serviceKey}) Object?
Returns a service of the specified serviceType, or null.
override
getServiceOf<T extends Object>({Object? serviceKey}) → T?
Returns a service of type T, or null.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
run(AgentSession? session, AgentRunOptions? options, {CancellationToken? cancellationToken, String? message, Iterable<ChatMessage>? messages}) Future<AgentResponse>
Runs the agent with the provided messages and returns the full response.
inherited
runCore(Iterable<ChatMessage> messages, {AgentSession? session, AgentRunOptions? options, CancellationToken? cancellationToken}) Future<AgentResponse>
Core implementation of the agent invocation logic.
override
runCoreStreaming(Iterable<ChatMessage> messages, {AgentSession? session, AgentRunOptions? options, CancellationToken? cancellationToken}) Stream<AgentResponseUpdate>
Core implementation of the agent streaming invocation logic.
override
runStreaming(AgentSession? session, AgentRunOptions? options, {CancellationToken? cancellationToken, String? message, Iterable<ChatMessage>? messages}) Stream<AgentResponseUpdate>
Runs the agent in streaming mode.
inherited
runTyped<T>(AgentSession? session, {AgentRunOptions? options, CancellationToken? cancellationToken, String? message, Iterable<ChatMessage>? messages}) Future<AgentResponseOf<T>>

Available on AIAgent, provided by the AIAgentStructuredOutputExtensions extension

Runs the agent and attempts to deserialize the response as type T.
serializeSession(AgentSession session, {Object? jsonSerializerOptions, CancellationToken? cancellationToken}) Future
Serializes an agent session to a JSON-compatible map.
inherited
serializeSessionCore(AgentSession session, {Object? jsonSerializerOptions, CancellationToken? cancellationToken}) Future
Core implementation of session serialization.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited