Genkit JS API reference
    Preparing search index...

    Module beta/client

    A simple, browser-safe client library for remotely running/streaming deployed Genkit flows.

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

    const response = await runFlow({
    url: 'https://my-flow-deployed-url',
    input: 'foo',
    });

    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);

    Functions

    runFlow
    streamFlow

    References

    AgentAPI → AgentAPI
    AgentChat → AgentChat
    AgentChunk → AgentChunk
    AgentError → AgentError
    AgentFinishReason → AgentFinishReason
    AgentInit → AgentInit
    AgentInput → AgentInput
    AgentInterrupt → AgentInterrupt
    AgentOutput → AgentOutput
    AgentResponse → AgentResponse
    AgentStreamChunk → AgentStreamChunk
    AgentTurn → AgentTurn
    applyPatch → applyPatch
    Artifact → Artifact
    DetachedTask → DetachedTask
    GenerationUsage → GenerationUsage
    JsonPatch → JsonPatch
    MessageData → MessageData
    Part → Part
    remoteAgent → remoteAgent
    RemoteAgentOptions → RemoteAgentOptions
    SessionSnapshot → SessionSnapshot
    SessionState → SessionState
    ToolRequestPart → ToolRequestPart
    ToolResponsePart → ToolResponsePart