langchain.js
    Preparing search index...

    Type Alias ResolveStreamInterface<T, Bag>

    ResolveStreamInterface: IsDeepAgent<T> extends true
        ? UseDeepAgentStream<
            InferStateType<T>,
            InferToolCalls<T>,
            InferSubagentStates<T>,
            Bag,
        >
        : IsReactAgent<T> extends true
            ? UseAgentStream<InferStateType<T>, InferToolCalls<T>, Bag>
            : BaseStream<InferStateType<T>, InferToolCalls<T>, Bag>

    Resolves the appropriate stream interface based on the agent/graph type.

    This type automatically selects the correct stream interface based on the type of agent or graph passed to useStream:

    1. DeepAgent (~deepAgentTypes) → UseDeepAgentStream

      • Includes: values, messages, toolCalls, subagents, getSubagentsByType, getSubagentsByMessage
    2. ReactAgent (~agentTypes) → UseAgentStream

      • Includes: values, messages, toolCalls, getToolCalls
      • Excludes: subagents, getSubagentsByType
    3. CompiledGraph (~RunOutput/~OutputType) → UseGraphStream

      • Includes: values, messages, submit, stop, nodes, getNodeStreamsByName
      • Excludes: toolCalls, subagents
      • Node names are inferred from ~NodeType for type-safe access
    4. Default → UseGraphStream

    Type Parameters

    • T

      The agent or graph type (use typeof agent or typeof graph)

    • Bag extends BagTemplate = BagTemplate

      Type configuration bag for interrupts, configurable, etc.

    // Automatic detection based on agent type
    type GraphStream = ResolveStreamInterface<typeof compiledGraph, BagTemplate>;
    // → UseGraphStream (with typed node names)

    type AgentStream = ResolveStreamInterface<typeof reactAgent, BagTemplate>;
    // → UseAgentStream (has toolCalls)

    type DeepStream = ResolveStreamInterface<typeof deepAgent, BagTemplate>;
    // → UseDeepAgentStream (has toolCalls AND subagents)