• 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: { headers?: Record<string, string>; input?: any; url: string }
      • Optionalheaders?: Record<string, string>

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

      • Optionalinput?: any

        Flow input.

      • url: string

        URL of the deployed flow.

    Returns { output: Promise<O>; stream: AsyncIterable<S> }