[PR #4011] [CLOSED] docs(event-streaming): fix raw event payload, text-delta type, and async examples #4021

Closed
opened 2026-06-05 18:53:55 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/docs/pull/4011
Author: @nick-hollon-lc
Created: 5/14/2026
Status: Closed

Base: mainHead: worktree-fix+event-streaming-docs


📝 Commits (2)

  • 0b65754 docs(event-streaming): fix raw event payload access and prioritize async for concurrent consumption
  • 69d7f08 docs(event-streaming): fix async examples — await astream_events and message.text

📊 Changes

3 files changed (+62 additions, -5 deletions)

View changed files

📝 src/oss/deepagents/event-streaming.mdx (+22 -3)
📝 src/oss/langchain/event-streaming.mdx (+19 -1)
📝 src/oss/langgraph/event-streaming.mdx (+21 -1)

📄 Description

Summary

  • deepagents: fix raw protocol event iteration in the "Consume concurrently" section — event[\"params\"][\"data\"] is a (event_dict, metadata) tuple so the payload is at data[0], and the delta type is \"text-delta\" not \"text\"
  • all three pages (deepagents, langchain, langgraph): reframe the Python multiple-projections section to lead with the async path (astream_events + asyncio.gather) and relegate stream.interleave() to a sync-only fallback
  • async examples verified: astream_events() returns a coroutine and requires await; message.text in async projections is an AsyncProjection and also requires await — both confirmed by running the examples against the live API

Test plan

  • All three async examples (deepagents, langchain, langgraph) run successfully against live API
  • Raw event structure confirmed: data is a 2-tuple, data[0] is the event dict, delta type is \"text-delta\"
  • make lint_prose passes on all changed files

AI involvement

Changes were implemented and verified with Claude Code.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/docs/pull/4011 **Author:** [@nick-hollon-lc](https://github.com/nick-hollon-lc) **Created:** 5/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `worktree-fix+event-streaming-docs` --- ### 📝 Commits (2) - [`0b65754`](https://github.com/langchain-ai/docs/commit/0b657546de6f15ef6afeb5b047af2a2ccf4722a3) docs(event-streaming): fix raw event payload access and prioritize async for concurrent consumption - [`69d7f08`](https://github.com/langchain-ai/docs/commit/69d7f08a6ec3b071a2412e93abe5e44f7439b583) docs(event-streaming): fix async examples — await astream_events and message.text ### 📊 Changes **3 files changed** (+62 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/oss/deepagents/event-streaming.mdx` (+22 -3) 📝 `src/oss/langchain/event-streaming.mdx` (+19 -1) 📝 `src/oss/langgraph/event-streaming.mdx` (+21 -1) </details> ### 📄 Description ## Summary - **deepagents**: fix raw protocol event iteration in the \"Consume concurrently\" section — `event[\"params\"][\"data\"]` is a `(event_dict, metadata)` tuple so the payload is at `data[0]`, and the delta type is `\"text-delta\"` not `\"text\"` - **all three pages** (deepagents, langchain, langgraph): reframe the Python multiple-projections section to lead with the async path (`astream_events` + `asyncio.gather`) and relegate `stream.interleave()` to a sync-only fallback - **async examples verified**: `astream_events()` returns a coroutine and requires `await`; `message.text` in async projections is an `AsyncProjection` and also requires `await` — both confirmed by running the examples against the live API ## Test plan - [x] All three async examples (`deepagents`, `langchain`, `langgraph`) run successfully against live API - [x] Raw event structure confirmed: `data` is a 2-tuple, `data[0]` is the event dict, delta type is `\"text-delta\"` - [x] `make lint_prose` passes on all changed files ## AI involvement Changes were implemented and verified with Claude Code. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 18:53:55 -04:00
yindo closed this issue 2026-06-05 18:53:55 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/docs#4021