A2aClient class final

An A2A client: discovers agents, sends messages, streams responses, and manages task lifecycles — all over injectable package:http.

Constructors

A2aClient({required String baseUrl, String? token, Client? client})

Properties

baseUrl → String
final
card → Future<AgentCard>
Fetches and caches the Agent Card from /.well-known/agent.json.
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token → String?
final

Methods

cancelTask(String taskId) → Future<A2aTask>
Cancels a task.
close() → void
getTask(String taskId) → Future<A2aTask>
Gets the current state of a task.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sendMessage(String text, {Map<String, dynamic>? metadata}) → Future<A2aTask>
Sends a message to the agent (non-streaming). Returns the task. metadata rides the message envelope (the A2A wire's standard message metadata — the fa-mail gateway marks fabric mail with it).
streamMessage(String text) → Stream<A2aTask>
Streams a message via SSE. Yields task state updates as they arrive.
toString() → String
A string representation of this object.
inherited

Operators

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