Interface UseStreamTransport<StateType, Bag>

Transport used to stream the thread. Only applicable for custom endpoints using toLangGraphEventStream or toLangGraphEventStreamResponse.

interface UseStreamTransport<StateType, Bag> {
    stream: ((payload) => Promise<AsyncGenerator<{
        data: unknown;
        event: string;
        id?: string;
    }, any, any>>);
}

Type Parameters

  • StateType extends Record<string, unknown> = Record<string, unknown>
  • Bag extends BagTemplate = BagTemplate

Implemented by

Properties

Properties

stream: ((payload) => Promise<AsyncGenerator<{
    data: unknown;
    event: string;
    id?: string;
}, any, any>>)

Type declaration

    • (payload): Promise<AsyncGenerator<{
          data: unknown;
          event: string;
          id?: string;
      }, any, any>>
    • Parameters

      • payload: {
            command: undefined | Command;
            context: undefined | GetConfigurableType<Bag>;
            input: undefined | null | GetUpdateType<Bag, StateType>;
            signal: AbortSignal;
        }
        • command: undefined | Command
        • context: undefined | GetConfigurableType<Bag>
        • input: undefined | null | GetUpdateType<Bag, StateType>
        • signal: AbortSignal

      Returns Promise<AsyncGenerator<{
          data: unknown;
          event: string;
          id?: string;
      }, any, any>>