LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
  • Stream
  • Overview
  • Getting started
  • injectStream
  • Selectors
  • Interrupts & headless tools
  • Subagents & subgraphs
  • Fork & edit from a checkpoint
  • Submission queue
  • Multimodal media
  • Transports
  • Dependency injection
  • Type safety
  • Migrating to v1
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
  • Stream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemoteStream
OverviewGetting startedinjectStreamSelectorsInterrupts & headless toolsSubagents & subgraphsFork & edit from a checkpointSubmission queueMultimodal mediaTransportsDependency injectionType safetyMigrating to v1
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServerStream
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/angularStreamService
Class●Since v0.2

StreamService

Copy
class StreamService

Constructors

Properties

Methods

View source on GitHub
constructor
constructor→ StreamService<T, InterruptType, ConfigurableType>
property
stream: UseStreamReturn<T, InterruptType, ConfigurableType>

Underlying StreamApi returned by useStream.

property
assistantId: string
property
client: Client
property
error: Signal<unknown>
property
hydrationPromise: Signal<Promise<void>>
property
interrupt: Signal<Interrupt<InterruptType> | undefined>
property
interrupts: Signal<Interrupt<InterruptType>[]>
property
isLoading: Signal<boolean>
property
isThreadLoading: Signal<boolean>
property
messages: Signal<BaseMessage<MessageStructure<MessageToolSet>, MessageType>[]>
property
subagents: Signal<ReadonlyMap<keyof InferSubagentStates<T> & string extends never ? string : keyof InferSubagentStates<T> & string, SubagentDiscoverySnapshot>>
property
subgraphs: Signal<ReadonlyMap<string, SubgraphDiscoverySnapshot>>
property
subgraphsByNode: Signal<ReadonlyMap<string, readonly SubgraphDiscoverySnapshot[]>>
property
threadId: Signal<string | null>
property
toolCalls: Signal<AssembledToolCall<string, unknown, unknown>[]>
property
values: Signal<InferStateType<T>>
method
disconnect→ Promise<void>
method
getThread→ ThreadStream<Record<string, unknown>> | undefined
method
respond→ Promise<void>
method
respondAll→ Promise<void>
method
stop→ Promise<void>
method
submit→ Promise<void>

@Injectable() wrapper around useStream. Extend this class with your own service when you want a DI-scoped, shareable StreamApi:

@Injectable({ providedIn: "root" })
export class ChatStream extends StreamService<ChatState> {
  constructor() {
    super({
      transport: new HttpAgentServerAdapter({ apiUrl: "/api/graph" }),
      assistantId: "chat",
    });
  }
}

The service exposes the same StreamApi surface as injectStream() — read data via signals (service.messages(), service.isLoading()) and use the imperative methods (service.submit(...), service.stop()).

Must be instantiated inside an Angular injection context. Its DestroyRef owns the controller lifetime, so scoping the service to a component tears down the stream when the component is destroyed.