RemoteAction<Input, Output, Chunk, Init> class interface

Represents a remote Genkit action (flow) that can be invoked or streamed.

This class is typically instantiated via defineRemoteAction. It encapsulates the URL, default headers, HTTP client, and data conversion logic for a specific flow.

Type parameters:

  • Output: The type of the output data from a non-streaming flow invocation, or the type of the final response from a streaming flow.
  • Chunk: The type of the data chunks streamed from the flow.

Constructors

RemoteAction({required String url, Map<String, String>? defaultHeaders, Client? httpClient, required Output fromResponse(dynamic jsonData), required Chunk fromStreamChunk(dynamic jsonData)?})
Represents a remote Genkit action (flow) that can be invoked or streamed.

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

call({required Input input, Init? init, Map<String, String>? headers}) → Future<Output>
Invokes the remote flow.
close() → void
Closes the underlying HTTP client if this RemoteAction created it.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stream({required Input input, Init? init, Map<String, String>? headers}) → ActionStream<Chunk, Output>
Invokes the remote flow and streams its response.
toString() → String
A string representation of this object.
inherited

Operators

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