LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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
WebChannelsPregelPrebuiltRemote
React SDK
Vue SDK
Svelte SDK
Angular SDK
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/langgraph-sdkstreamMediaBase
Interface●Since v2.0

MediaBase

Shared surface across every media handle returned by MediaAssembler.

The handle is live while its parent message is active:

  • partialBytes is a snapshot of all bytes received so far.
  • stream is a lazy, single-consumer byte stream (see accessor docstring).
  • blob / objectURL settle on message-finish.
  • error becomes set if the handle terminates in any of the MediaAssemblyErrorKind failure modes.
Copy
interface MediaBase

Properties

property
blob: Promise<Blob>

Resolves on message-finish with the concatenated Blob.

property
error: MediaAssemblyError
property
id: string
property
messageId: string
property
mimeType: string
property
monotonic: boolean

Diagnostic: false if block indices arrived out of order.

property
namespace: string[]
property
node: string
property
objectURL: Promise<string>

Lazy URL.createObjectURL over blob. Cached: first access creates the URL, subsequent accesses return the same one. Call revoke to free the URL slot; the next access creates a fresh URL. ThreadStream.close() auto-revokes as a safety net.

property
partialBytes: Uint8Array
property
stream: ReadableStream<Uint8Array<ArrayBufferLike>>

Live byte stream.

Lazy: not materialised unless accessed. On first access the stream is seeded with every byte already accumulated (partialBytes) and then wired to future chunks. For URL-sourced blocks, first access triggers fetch() and pipes the response body through.

Repeated access returns the same ReadableStream reference — you can safely read it once, release the lock, and re-acquire a reader later (e.g. React StrictMode effect re-invokes). The standard ReadableStream.locked semantics prevent concurrent readers; use stream.tee() when you truly need multiple live consumers.

property
url: string

Present iff the originating block carried url (not data). When set, blob / stream / objectURL lazily fetch from here on first access.

Methods

method
revoke

Revoke the currently-cached object URL (if any). Subsequent accesses to objectURL create a fresh URL from the Blob. Idempotent.

View source on GitHub