RemoteAction<O, S> class

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:

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

Constructors

RemoteAction.new({required String url, Map<String, String>? defaultHeaders, Client? httpClient, required O fromResponse(dynamic jsonData), S 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<I>({required I input, Map<String, String>? headers}) Future<O>
Invokes the remote flow.
dispose() → void
Disposes of the underlying HTTP client if it was created by this RemoteAction. Call this when the RemoteAction is no longer needed to free up resources, but only if an httpClient was not provided at construction.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stream<I>({required I input, Map<String, String>? headers}) FlowStreamResponse<O?, S>
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