RemoteAction<Input, Output, Chunk, Init> constructor
RemoteAction<Input, Output, Chunk, Init> ({})
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.
Implementation
RemoteAction({
required this._url,
this._defaultHeaders,
http.Client? httpClient,
required this._fromResponse,
required this._fromStreamChunk,
}) : _httpClient = httpClient ?? http.Client(),
_ownsHttpClient = httpClient == null;