• A React hook that provides seamless integration with LangGraph streaming capabilities.

    The useStream hook handles all the complexities of streaming, state management, and branching logic, letting you focus on building great chat experiences. It provides automatic state management for messages, interrupts, loading states, and errors.

    Type Parameters

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

      The type of the thread state (default: Record<string, unknown>)

    • Bag extends {
          ConfigurableType?: Record<string, unknown>;
          CustomEventType?: unknown;
          InterruptType?: unknown;
          UpdateType?: unknown;
      } = BagTemplate

      Type configuration bag containing:

      • ConfigurableType: Type for the config.configurable property
      • InterruptType: Type for interrupt values
      • CustomEventType: Type for custom events
      • UpdateType: Type for the submit function updates

    Parameters

    Returns UseStream<StateType, Bag>

  • A React hook that provides seamless integration with LangGraph streaming capabilities.

    The useStream hook handles all the complexities of streaming, state management, and branching logic, letting you focus on building great chat experiences. It provides automatic state management for messages, interrupts, loading states, and errors.

    Type Parameters

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

      The type of the thread state (default: Record<string, unknown>)

    • Bag extends {
          ConfigurableType?: Record<string, unknown>;
          CustomEventType?: unknown;
          InterruptType?: unknown;
          UpdateType?: unknown;
      } = BagTemplate

      Type configuration bag containing:

      • ConfigurableType: Type for the config.configurable property
      • InterruptType: Type for interrupt values
      • CustomEventType: Type for custom events
      • UpdateType: Type for the submit function updates

    Parameters

    Returns UseStreamCustom<StateType, Bag>

  • A React hook that provides seamless integration with LangGraph streaming capabilities.

    The useStream hook handles all the complexities of streaming, state management, and branching logic, letting you focus on building great chat experiences. It provides automatic state management for messages, interrupts, loading states, and errors.

    Type Parameters

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

      The type of the thread state (default: Record<string, unknown>)

    • Bag extends {
          ConfigurableType?: Record<string, unknown>;
          CustomEventType?: unknown;
          InterruptType?: unknown;
          UpdateType?: unknown;
      } = BagTemplate

      Type configuration bag containing:

      • ConfigurableType: Type for the config.configurable property
      • InterruptType: Type for interrupt values
      • CustomEventType: Type for custom events
      • UpdateType: Type for the submit function updates

    Parameters

    Returns UseStream<StateType, Bag>