Skip to content

docs(langchain): document middleware-registered stream transformers#4126

Open
Nick Hollon (nick-hollon-lc) wants to merge 2 commits into
mainfrom
nh/middleware-transformers
Open

docs(langchain): document middleware-registered stream transformers#4126
Nick Hollon (nick-hollon-lc) wants to merge 2 commits into
mainfrom
nh/middleware-transformers

Conversation

@nick-hollon-lc
Copy link
Copy Markdown
Contributor

@nick-hollon-lc Nick Hollon (nick-hollon-lc) commented May 21, 2026

Documents the new AgentMiddleware.transformers attribute introduced in langchain-ai/langchain#37591. Middleware can now declare scope-aware StreamTransformer factories alongside their tools and lifecycle hooks; create_agent merges them with caller-supplied transformers= at compile time.

Summary

  • Adds a Register transformers on middleware subsection under "Custom updates" in src/oss/langchain/event-streaming.mdx.
  • Shows the compile-time merge order: ToolCallTransformer → middleware-registered factories (in middleware order) → caller-supplied transformers= from create_agent.
  • Python-only (:::python fenced) — the upstream PR only ships the Python surface. JS parity can be documented when langchainjs adds the equivalent.

Reviewer notes

Test plan

  • make lint_prose FILES="src/oss/langchain/event-streaming.mdx" — clean
  • Visual review of the rendered "Custom updates" section in Mintlify preview
  • Confirm the final langchain release tag matches the <Note> before merge

Add a subsection to the LangChain event streaming page covering the new
`AgentMiddleware.transformers` attribute (langchain-ai/langchain#37591),
including the compile-time merge order: ToolCallTransformer →
middleware-registered factories → caller-supplied `transformers=`.
@github-actions github-actions Bot added langchain For docs changes to LangChain oss labels 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:

  • @npentrel or @lnhsingh (LangChain)

@github-actions
Copy link
Copy Markdown
Contributor

Mintlify preview branch generated: preview-nhmidd-1779380202-e986092

Site preview: https://langchain-5e9cc07a-preview-nhmidd-1779380202-e986092.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 langchain For docs changes to LangChain oss

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant