AgentApi<State> class final

The transport-agnostic surface for talking to an agent. The same shape is returned by ai.defineAgent(...) on the server and by remoteAgent(...) on the client.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

abort(String snapshotId, {Map<String, dynamic>? context}) Future<SnapshotStatus?>
Aborts a running snapshot. Requires a server store. Returns the prior status, or null.
chat({String? snapshotId, String? sessionId, SessionState? state}) AgentChat<State>
Starts a new chat, optionally attaching via snapshotId / sessionId / state (provide at most one).
close() FutureOr<void>
Releases any resources owned by the underlying transport (e.g. an HTTP client created by remoteAgent). A caller-supplied HTTP client is left open, since it stays caller-owned. Safe to call on the in-process agent (a no-op there).
getSnapshot({String? snapshotId, String? sessionId, Map<String, dynamic>? context, bool metadataOnly = false}) Future<AgentSnapshot<State>?>
Reads a snapshot without starting a chat. Requires a server store.
loadChat({String? snapshotId, String? sessionId, Map<String, dynamic>? context}) Future<AgentChat<State>>
Loads a server snapshot and returns a chat with history restored. Provide exactly one of snapshotId / sessionId.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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