Skip to content

docs(langsmith): event-streaming API page for langgraph-api 0.9.0rc1#4132

Open
Nick Hollon (nick-hollon-lc) wants to merge 3 commits into
mainfrom
nh/langsmith-event-streaming-0.9.0rc1
Open

docs(langsmith): event-streaming API page for langgraph-api 0.9.0rc1#4132
Nick Hollon (nick-hollon-lc) wants to merge 3 commits into
mainfrom
nh/langsmith-event-streaming-0.9.0rc1

Conversation

@nick-hollon-lc
Copy link
Copy Markdown
Contributor

Summary

New langsmith/event-streaming page covering the v3 thread-centric streaming API in the LangGraph SDK (client.threads.stream(...)) for langgraph-api>=0.9.0rc1, plus the surrounding nav wiring and a Tip on the legacy streaming page pointing new applications at it.

The page (Python, JavaScript, and cURL) was validated against:

  • Python SDK: langchain-ai/langgraph#7884 (nh/sdk-py-v3-streaming-integration-pytest), diffed against main — covers the full v3 streaming stack under libs/sdk-py/langgraph_sdk/_async/, _sync/, and stream/.
  • JavaScript SDK: langchain-ai/langgraphjs main (libs/sdk/src/client/stream/, libs/sdk/src/client/threads/), plus the canonical examples/streaming/src/human-in-the-loop/remote.ts and examples/streaming/src/basic/remote.ts examples.
  • Wire protocol: libs/sdk-py/langgraph_sdk/stream/transport/http.py for the URL shape, build_event_stream_body for the /stream/events body, and send_command for the /commands JSON-RPC envelope.

Notable corrections vs. the initial scaffold

  • thread.run.respond(response, *, interrupt_id=...) — namespace is derived from the matched interrupt, not a parameter.
  • JS interrupt resume uses thread.input.respond({...}) (the InputModule), and interrupt.interruptId is camelCase on the JS side while the wire param stays interrupt_id.
  • client.threads.stream(...) in JS is synchronous and takes either (options) or (threadId, options) — dropped spurious await and undefined first arg.
  • thread.subscribe([...]) is an AsyncIterator in Python (iterate, do not async with) and a Promise<SubscriptionHandle> in JS (must be await-ed).
  • cURL examples now reflect the actual two-endpoint wire protocol: POST /stream/events with {"channels": [...]} opens the SSE subscription, and POST /commands carries the JSON-RPC run.start / input.respond envelopes.
  • Removed nonexistent thread.audio / images / video / files projections.
  • Removed running from the lifecycle event list — v3 emits started, completed, failed, interrupted.
  • Rewrote the "Resume from last event" section: since= is internal to the SDK; reopening the subscription with the same thread_id is the public path.
  • Noted that thread.subagents is an alias for thread.subgraphs.

Worth a careful look

  • The version pins in the top-of-page Note (langgraph-api>=0.9.0rc1, langgraph>=1.2.0, langgraph-sdk>=0.3.14, @langchain/langgraph-sdk>=1.9.2) — PR 7884 doesn't bump version files, so please confirm against the release notes / package manifests before merging.
  • The Resume from last event rewrite still says reopening replays from the start of the run — confirm against the production buffering policy if there's a TTL.
  • AI agent involvement: this PR (and the validation pass against PR 7884 / langgraphjs main) was drafted with Claude Code.

Test plan

  • make lint_prose FILES="src/langsmith/event-streaming.mdx" — clean
  • make broken-links — no broken links
  • Mintlify preview: render the page locally and confirm the Tabs, Notes, and code highlighting all render correctly
  • Smoke-test the Python Quickstart snippet against a langgraph-api>=0.9.0rc1 deployment
  • Smoke-test the JS Quickstart snippet against the same deployment

- Add Tip at the top of langsmith/streaming.mdx pointing new
  applications to /langsmith/event-streaming for langgraph-api
  0.9.0rc1+; rest of the legacy page untouched.
- Add "langsmith/event-streaming" to the Agent deployment → Core
  capabilities nav group in src/docs.json, immediately before the
  legacy "langsmith/streaming" entry (mirrors OSS nav ordering).
- Add an Event streaming Card to core-capabilities.mdx above the
  legacy Streaming API Card; reframe the legacy entry as supported
  alongside.
- Fix em-dash spacing in the event-streaming intro and the new Tip
  (LangChain.DashesSpaces Vale rule).
Validate the Python SDK examples against the v3 streaming code in
langchain-ai/langgraph#7884 and the JS SDK examples against
langchain-ai/langgraphjs main, and fix the divergences.

Python SDK
- thread.run.respond uses (response, *, interrupt_id=...) — namespace
  is derived from the matched interrupt, not a parameter.
- thread.subscribe(...) returns an AsyncIterator; iterate it directly
  instead of opening as an async context manager.

JS SDK
- client.threads.stream(...) is synchronous and takes either an
  options object or (threadId, options) — drop spurious await and
  undefined first arg.
- Interrupt resume goes through thread.input.respond({...}); the
  interrupt object surfaces interruptId in camelCase while the wire
  param keeps snake_case interrupt_id.
- await thread.subscribe([...]) — subscribe returns a Promise.

Wire protocol (cURL)
- Stream-open POST body is {"channels": [...]} (plus optional
  namespaces / depth). Replace the fabricated assistant_id/input
  bodies in every per-projection example.
- run.start is a separate command on POST /threads/{id}/commands with
  a JSON-RPC envelope: {"id": N, "method": "run.start", "params": {
  "assistant_id": ..., "input": ...}}.
- Interrupt resume uses {"id": N, "method": "input.respond",
  "params": {"namespace": ..., "interrupt_id": ..., "response": ...}}
  instead of the fabricated command/type shape.

Other corrections
- Drop thread.audio / images / video / files from the projections
  table — they don't exist in the SDK.
- Note thread.subagents is an alias for thread.subgraphs.
- Remove "running" from the lifecycle event list — v3 emits started,
  completed, failed, interrupted.
- Rewrite "Resume from last event": since= is internal to the SDK,
  and the wire protocol does not use Last-Event-ID for resumption;
  the server replays buffered events on every new subscription and
  the SDK dedupes by seq / event_id.

Also tweak core-capabilities and streaming intro wording for
consistency with the corrected page.
@github-actions github-actions Bot added the langsmith For docs changes to LangSmith label May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for opening a docs PR, Nick Hollon (@nick-hollon-lc)! When it's ready for review, please add the relevant reviewers:

  • @katmayb or @fjmorris (LangSmith)

@github-actions
Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-nhlang-1779401817-6c3eb92

Site preview: https://langchain-5e9cc07a-preview-nhlang-1779401817-6c3eb92.mintlify.app

Preview links may take a few minutes to start working while the deployment finishes.

Changed documentation pages (preview deep links):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal langsmith For docs changes to LangSmith

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant