Genkit JS API reference
    Preparing search index...

    Function streamFlow

    • Invoke and stream response from a deployed flow.

      For example:

      import { streamFlow } from 'genkit/beta/client';

      const response = streamFlow({
      url: 'https://my-flow-deployed-url',
      input: 'foo',
      });
      for await (const chunk of response.stream) {
      console.log(chunk);
      }
      console.log(await response.output);

      Type Parameters

      • O = any
      • S = any

      Parameters

      • __namedParameters: {
            abortSignal?: AbortSignal;
            headers?: Record<string, string>;
            input?: any;
            streamId?: string;
            url: string;
        }
        • OptionalabortSignal?: AbortSignal

          Abort signal to abort the request.

        • Optionalheaders?: Record<string, string>

          A map of HTTP headers to be added to the HTTP call.

        • Optionalinput?: any

          Flow input.

        • OptionalstreamId?: string

          Stream ID to connect to.

        • url: string

          URL of the deployed flow.

      Returns {
          output: Promise<O>;
          stream: AsyncIterable<S>;
          streamId: Promise<string | null>;
      }