Files
langgraphjs/examples/streaming
dependabot[bot] a4919b667e chore(deps): bump the langchain group across 1 directory with 8 updates (#2476)
Bumps the langchain group with 8 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [@langchain/anthropic](https://github.com/langchain-ai/langchainjs) |
`1.3.28` | `1.4.0` |
| [@langchain/core](https://github.com/langchain-ai/langchainjs) |
`1.1.44` | `1.1.48` |
| [langchain](https://github.com/langchain-ai/langchainjs) |
`1.4.0-dev-1777615538778` | `1.4.4` |
| [@langchain/openai](https://github.com/langchain-ai/langchainjs) |
`1.4.5` | `1.4.7` |
| [@langchain/groq](https://github.com/langchain-ai/langchainjs) |
`1.2.0` | `1.2.1` |
| [@langchain/mistralai](https://github.com/langchain-ai/langchainjs) |
`1.0.8` | `1.1.0` |
| [@langchain/classic](https://github.com/langchain-ai/langchainjs) |
`1.0.32` | `1.0.34` |
| [langsmith](https://github.com/langchain-ai/langsmith-sdk) | `0.6.0` |
`0.7.4` |


Updates `@langchain/anthropic` from 1.3.28 to 1.4.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/anthropic's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/anthropic</code><a
href="https://github.com/1"><code>@​1</code></a>.4.0</h2>
<h3>Minor Changes</h3>
<ul>
<li><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10777">#10777</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/0cfcfc66897d8fafeb7e7ed90b7299eace9a7c37"><code>0cfcfc6</code></a>
Thanks <a
href="https://github.com/jonaslalin"><code>@​jonaslalin</code></a>! -
feat(anthropic): support strict tool calling for custom tools</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchainjs/commits/@langchain/anthropic@1.4.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@langchain/core` from 1.1.44 to 1.1.48
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/core's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/core</code><a
href="https://github.com/1"><code>@​1</code></a>.1.48</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10832">#10832</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/1b24369a970ad6f56f1f428027f48601f87e62eb"><code>1b24369</code></a>
Thanks <a
href="https://github.com/info-arnav"><code>@​info-arnav</code></a>! -
fix(core, openrouter): make CJS default re-exports callable</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10666">#10666</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/2bb55b053f49f89e81e3252a7af08e86d71ddd95"><code>2bb55b0</code></a>
Thanks <a
href="https://github.com/hnustwjj"><code>@​hnustwjj</code></a>! -
feat(openrouter): surface reasoning content as v1 standard content
blocks</p>
<p><code>convertOpenRouterResponseToBaseMessage</code> and
<code>convertOpenRouterDeltaToBaseMessageChunk</code> now copy
OpenRouter's
<code>reasoning</code> (flat string) and <code>reasoning_details</code>
(structured array) fields
onto <code>additional_kwargs.reasoning_content</code> /
<code>additional_kwargs.reasoning_details</code>.
A new <code>ChatOpenRouterTranslator</code> is registered in
<code>@langchain/core</code> under
the <code>&quot;openrouter&quot;</code> provider key so
<code>AIMessage.contentBlocks</code> emits standard
<code>{type: &quot;reasoning&quot;}</code> blocks alongside text and
tool calls.</p>
<p>Previously, reasoning text returned by reasoning-capable models
routed
through OpenRouter (DeepSeek R1, Minimax M2, Claude extended thinking,
o-series, etc.) was silently dropped: only the
<code>reasoning_tokens</code> count
was preserved via <code>usage_metadata</code>. Consumers using standard
content blocks
(including the frontend agent UI patterns shown in the docs) could not
display the model's chain of thought.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10918">#10918</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/3999fab55870c6eea22d6d90c08aa472f9b2fac3"><code>3999fab</code></a>
Thanks <a
href="https://github.com/christian-bromann"><code>@​christian-bromann</code></a>!
- fix(openai): stream custom tool calls through Responses API chunks</p>
</li>
</ul>
<h2><code>@​langchain/core</code><a
href="https://github.com/1"><code>@​1</code></a>.1.47</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10906">#10906</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/f61b3450f275831e47e69c08899b4a2b67b4bdb3"><code>f61b345</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
feat(core): add uuid v6 utility support</p>
<p>Add <code>v6</code> UUID generation support to
<code>@langchain/core/utils/uuid</code> by vendoring the upstream uuidjs
<code>v6</code> implementation and its <code>v1ToV6</code> helper,
exporting <code>v6</code> from the UUID utils index, and adding tests
for deterministic generation, buffer/offset behavior,
validation/versioning, and ordering.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10872">#10872</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/a64007997a4940f51bba3c1c83dae89d1ccfb692"><code>a640079</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
chore(deps): remove redundant <code>@​types/uuid</code> declarations</p>
<p>Remove <code>@types/uuid</code> from package manifests that rely on
<code>@langchain/core/utils/uuid</code> or do not require uuid type
stubs directly, and refresh the lockfile entries accordingly.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10792">#10792</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/3682268cd1844b2573b01f07bee367e21cb7bdc7"><code>3682268</code></a>
Thanks <a href="https://github.com/Genmin"><code>@​Genmin</code></a>! -
fix(core): apply v1 message casting after implicit streaming
aggregation</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10901">#10901</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/f26fc4a6f461d6d0f86d59bd00197ad510432c4a"><code>f26fc4a</code></a>
Thanks <a
href="https://github.com/christian-bromann"><code>@​christian-bromann</code></a>!
- fix(testing): share fakeModel invocation state across bindTools
instances</p>
</li>
</ul>
<h2><code>@​langchain/core</code><a
href="https://github.com/1"><code>@​1</code></a>.1.46</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10847">#10847</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/1659e7d36e31e315c890fa98f43db887f7a2d52b"><code>1659e7d</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
chore(core): reduce transitive dependency exposure and tighten release
hygiene</p>
<p>Remove direct runtime dependencies on <code>ansi-styles</code>,
<code>camelcase</code>, and <code>decamelize</code>
by inlining equivalent logic in core internals, and enable npm
provenance in the
release workflow.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10790">#10790</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/ef78bc6a21f9a8808ba95c98db2023f0a6b51bcc"><code>ef78bc6</code></a>
Thanks <a href="https://github.com/Genmin"><code>@​Genmin</code></a>! -
fix(core): keep different content block types separate when merging
chunks</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchainjs/commits/@langchain/core@1.1.48">compare
view</a></li>
</ul>
</details>
<br />

Updates `langchain` from 1.4.0-dev-1777615538778 to 1.4.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">langchain's
releases</a>.</em></p>
<blockquote>
<h2>langchain@1.4.2</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10900">#10900</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/6bbddca1f8f7f280583fd839bb40c00bf19a0d51"><code>6bbddca</code></a>
Thanks <a
href="https://github.com/christian-bromann"><code>@​christian-bromann</code></a>!
- fix(langchain): unwrap tool message outputs in agent streams</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10706">#10706</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/4ecb6606feae3156a07de67e39e2027f857c476e"><code>4ecb660</code></a>
Thanks <a
href="https://github.com/JadenKim-dev"><code>@​JadenKim-dev</code></a>!
- fix(langchain): set name on todoListMiddleware ToolMessages</p>
</li>
</ul>
<h2>langchain@1.4.1</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10879">#10879</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/eb480cb6df8e0fa792826155bfa00a6db4536444"><code>eb480cb</code></a>
Thanks <a
href="https://github.com/vignesh-gep"><code>@​vignesh-gep</code></a>! -
fix(langchain/createAgent): throw on terminal
<code>providerStrategy</code> parse failure instead of silently
resolving with <code>structuredResponse: undefined</code></p>
<p>When <code>createAgent</code> was configured with
<code>responseFormat</code> resolving to a <code>providerStrategy</code>
(either passed explicitly or auto-promoted from a bare Zod / JSON schema
for models whose profile reports <code>structuredOutput: true</code>),
and the model produced a terminal response (no <code>tool_calls</code>)
whose text could not be JSON-parsed or did not satisfy the schema, the
agent silently exited with no <code>structuredResponse</code>, surfacing
later as <code>TypeError: Cannot read properties of undefined</code>.
The agent now throws a <code>StructuredOutputParsingError</code> in that
case while still allowing the agent loop to continue when tool calls are
present. Closes <a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10878">#10878</a>.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10872">#10872</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/a64007997a4940f51bba3c1c83dae89d1ccfb692"><code>a640079</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
chore(deps): remove redundant <code>@​types/uuid</code> declarations</p>
<p>Remove <code>@types/uuid</code> from package manifests that rely on
<code>@langchain/core/utils/uuid</code> or do not require uuid type
stubs directly, and refresh the lockfile entries accordingly.</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10160">#10160</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/bba900c7c8781c7efec856d5d3e539a93f14e797"><code>bba900c</code></a>
Thanks <a
href="https://github.com/JadenKim-dev"><code>@​JadenKim-dev</code></a>!
- fix(langchain): prevent llmToolSelectorMiddleware from leaking into
message stream</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchainjs/commits/@langchain/openai@1.4.4">compare
view</a></li>
</ul>
</details>
<br />

Updates `@langchain/openai` from 1.4.5 to 1.4.7
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/openai's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/openai</code><a
href="https://github.com/1"><code>@​1</code></a>.4.7</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10918">#10918</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/3999fab55870c6eea22d6d90c08aa472f9b2fac3"><code>3999fab</code></a>
Thanks <a
href="https://github.com/christian-bromann"><code>@​christian-bromann</code></a>!
- fix(openai): stream custom tool calls through Responses API chunks</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10791">#10791</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/fce9ab418901323618fdfaaa9fc350fa1c0d50e0"><code>fce9ab4</code></a>
Thanks <a href="https://github.com/Genmin"><code>@​Genmin</code></a>! -
fix(openai): preserve top-level Responses API ids on AI messages</p>
</li>
</ul>
<h2><code>@​langchain/openai</code><a
href="https://github.com/1"><code>@​1</code></a>.4.6</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10902">#10902</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/229a7ad67b9a7ebd8df3ca451e0b8195bea0190e"><code>229a7ad</code></a>
Thanks <a
href="https://github.com/christian-bromann"><code>@​christian-bromann</code></a>!
- fix(openai): preserve v1 assistant tool calls</p>
</li>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10895">#10895</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/36fb0ef1dc76c096dcfa0c777e10c9f9365a5240"><code>36fb0ef</code></a>
Thanks <a href="https://github.com/BertBR"><code>@​BertBR</code></a>! -
fix(openai): guard bare <code>JSON.parse</code> in Responses API
converter against trailing non-whitespace characters</p>
<p><code>convertResponsesDeltaToChatGenerationChunk</code> previously
called <code>JSON.parse(msg.text)</code> directly when
<code>response.text.format.type === &quot;json_schema&quot;</code>. Some
models (observed with <code>gpt-5-mini</code> on <code>service_tier:
&quot;auto&quot;</code>) intermittently emit trailing non-whitespace
characters (extra tokens, control characters) after a valid JSON object,
causing a <code>SyntaxError</code> that propagates as an unhandled
exception and kills the entire streaming response mid-flight. The parse
is now wrapped in a <code>try</code>/<code>catch</code>: on failure,
<code>additional_kwargs.parsed</code> is left undefined, the stream
completes normally, and the existing <code>withStructuredOutput</code>
pipeline handles the typed failure — <code>includeRaw: true</code>
returns <code>{ raw, parsed: null }</code> via its
<code>withFallbacks</code> wrapper, <code>includeRaw: false</code>
throws a typed <code>OutputParserException</code> that the caller can
catch and retry. Closes <a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10894">#10894</a>.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchainjs/commits/@langchain/openai@1.4.7">compare
view</a></li>
</ul>
</details>
<br />

Updates `@langchain/groq` from 1.2.0 to 1.2.1
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/groq's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/groq</code><a
href="https://github.com/1"><code>@​1</code></a>.2.1</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10872">#10872</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/a64007997a4940f51bba3c1c83dae89d1ccfb692"><code>a640079</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
chore(deps): remove redundant <code>@​types/uuid</code> declarations</p>
<p>Remove <code>@types/uuid</code> from package manifests that rely on
<code>@langchain/core/utils/uuid</code> or do not require uuid type
stubs directly, and refresh the lockfile entries accordingly.</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/1b19e4f84d747b481879363b4884c20eb1c0f1a4"><code>1b19e4f</code></a>
chore: version packages (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10899">#10899</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/426e3aba21016d9ee070c3d130f74ae0047c9ce5"><code>426e3ab</code></a>
chore: fix uuid changeset (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10916">#10916</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/245c98216ce4a6c4340954711a7ad60203283424"><code>245c982</code></a>
chore(deps): bump fast-xml-builder from 1.1.5 to 1.2.0 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10914">#10914</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/126dac5a7a2fac5978448185893038ac8ea6d994"><code>126dac5</code></a>
chore(deps): bump brace-expansion from 5.0.5 to 5.0.6 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10912">#10912</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/1abe24becdddce94c5bd2acfaf920b60a683f22b"><code>1abe24b</code></a>
chore(deps): bump fast-uri from 3.1.0 to 3.1.2 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10913">#10913</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/229a7ad67b9a7ebd8df3ca451e0b8195bea0190e"><code>229a7ad</code></a>
fix(openai): preserve v1 assistant tool calls (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10902">#10902</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/f26fc4a6f461d6d0f86d59bd00197ad510432c4a"><code>f26fc4a</code></a>
fix(core): share fakeModel invocation state across bindTools instances
(<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10901">#10901</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/a0cd7477e59677c8d15e0e70b374afa0a2410582"><code>a0cd747</code></a>
chore(deps): bump fast-xml-builder from 1.1.5 to 1.1.9 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10910">#10910</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/b208e625865fc7487876b652f479dbf854263e68"><code>b208e62</code></a>
chore(deps): bump ip-address from 10.1.0 to 10.2.0 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10909">#10909</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/f7e50fb8b98bd9969c0f5cf0967a06df15453453"><code>f7e50fb</code></a>
feat(google): Service tier and custom headers (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10704">#10704</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/langchain-ai/langchainjs/compare/@langchain/groq@1.2.0...@langchain/groq@1.2.1">compare
view</a></li>
</ul>
</details>
<br />

Updates `@langchain/mistralai` from 1.0.8 to 1.1.0
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/mistralai's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/mistralai</code><a
href="https://github.com/1"><code>@​1</code></a>.1.0</h2>
<h3>Minor Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10873">#10873</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/a74d574f7f086bea2f5c7a852e869f7d24be2f55"><code>a74d574</code></a>
Thanks <a
href="https://github.com/baptistejamin"><code>@​baptistejamin</code></a>!
- chore(mistralai): upgrade to <code>@​mistralai/mistralai</code> v2</p>
<p>Also populates <code>response_metadata.model</code> on chat
completions (was missing before).</p>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/caad0914f068477293009dbf27a220fa96bdc4b8"><code>caad091</code></a>
chore: version packages (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10919">#10919</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/f4a6149e3e754203f5886dd8c2bccaa7a6fd4f81"><code>f4a6149</code></a>
chore(deps): bump fast-uri from 3.1.0 to 3.1.2 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10926">#10926</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/7b12f6dfa537932073f96b561d7c851b30d69132"><code>7b12f6d</code></a>
chore(deps): bump protobufjs from 7.5.6 to 7.6.0 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10930">#10930</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/5c6c5fef0cb392e782675ca5926e291a4295a653"><code>5c6c5fe</code></a>
chore(deps): bump ws from 5.2.4 to 8.20.0 (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10915">#10915</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/a8652ceeb5e36434565c96fc1a6bd9a4a36304cc"><code>a8652ce</code></a>
docs: fix typos, add Ollama setup, update outdated references (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10922">#10922</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/2bb55b053f49f89e81e3252a7af08e86d71ddd95"><code>2bb55b0</code></a>
feat(openrouter): surface reasoning as v1 standard content blocks (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10666">#10666</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/4ecb6606feae3156a07de67e39e2027f857c476e"><code>4ecb660</code></a>
fix(langchain): set name on todoListMiddleware ToolMessages (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10706">#10706</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/20f27dff08a4bd5a1a16c1c71a88405c9df82914"><code>20f27df</code></a>
fix(ibm): handle API errors in streaming responses (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10721">#10721</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/45668734c3205e631cdd33ac071bbf733f4558c7"><code>4566873</code></a>
feat(ibm): add integration test to IBM implementation (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10732">#10732</a>)</li>
<li><a
href="https://github.com/langchain-ai/langchainjs/commit/6e4337fec1a7707c1a1c709a7b6aa0c5efb7b11d"><code>6e4337f</code></a>
fix(aws): add claude-haiku-4 to supportedToolChoiceValuesForModel (<a
href="https://redirect.github.com/langchain-ai/langchainjs/issues/10743">#10743</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/langchain-ai/langchainjs/compare/@langchain/classic@1.0.8...@langchain/mistralai@1.1.0">compare
view</a></li>
</ul>
</details>
<br />

Updates `@langchain/classic` from 1.0.32 to 1.0.34
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langchainjs/releases">@​langchain/classic's
releases</a>.</em></p>
<blockquote>
<h2><code>@​langchain/classic</code><a
href="https://github.com/1"><code>@​1</code></a>.0.34</h2>
<h3>Patch Changes</h3>
<ul>
<li>Updated dependencies [<a
href="https://github.com/langchain-ai/langchainjs/commit/3999fab55870c6eea22d6d90c08aa472f9b2fac3"><code>3999fab</code></a>,
<a
href="https://github.com/langchain-ai/langchainjs/commit/fce9ab418901323618fdfaaa9fc350fa1c0d50e0"><code>fce9ab4</code></a>]:
<ul>
<li><code>@​langchain/openai</code><a
href="https://github.com/1"><code>@​1</code></a>.4.7</li>
</ul>
</li>
</ul>
<h2><code>@​langchain/classic</code><a
href="https://github.com/1"><code>@​1</code></a>.0.33</h2>
<h3>Patch Changes</h3>
<ul>
<li>
<p><a
href="https://redirect.github.com/langchain-ai/langchainjs/pull/10872">#10872</a>
<a
href="https://github.com/langchain-ai/langchainjs/commit/a64007997a4940f51bba3c1c83dae89d1ccfb692"><code>a640079</code></a>
Thanks <a href="https://github.com/hntrl"><code>@​hntrl</code></a>! -
chore(deps): remove redundant <code>@​types/uuid</code> declarations</p>
<p>Remove <code>@types/uuid</code> from package manifests that rely on
<code>@langchain/core/utils/uuid</code> or do not require uuid type
stubs directly, and refresh the lockfile entries accordingly.</p>
</li>
<li>
<p>Updated dependencies [<a
href="https://github.com/langchain-ai/langchainjs/commit/229a7ad67b9a7ebd8df3ca451e0b8195bea0190e"><code>229a7ad</code></a>,
<a
href="https://github.com/langchain-ai/langchainjs/commit/36fb0ef1dc76c096dcfa0c777e10c9f9365a5240"><code>36fb0ef</code></a>]:</p>
<ul>
<li><code>@​langchain/openai</code><a
href="https://github.com/1"><code>@​1</code></a>.4.6</li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/langchain-ai/langchainjs/commits/@langchain/classic@1.0.34">compare
view</a></li>
</ul>
</details>
<br />

Updates `langsmith` from 0.6.0 to 0.7.4
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/langchain-ai/langsmith-sdk/releases">langsmith's
releases</a>.</em></p>
<blockquote>
<h2>v0.7.4</h2>
<h2>What's Changed</h2>
<ul>
<li>fix(google-adk): add wrapt dependency by <a
href="https://github.com/QuentinBrosse"><code>@​QuentinBrosse</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2436">langchain-ai/langsmith-sdk#2436</a></li>
<li>chore: lock dependencies by <a
href="https://github.com/QuentinBrosse"><code>@​QuentinBrosse</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2439">langchain-ai/langsmith-sdk#2439</a></li>
<li>release(py): 0.7.4 by <a
href="https://github.com/QuentinBrosse"><code>@​QuentinBrosse</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2441">langchain-ai/langsmith-sdk#2441</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/langchain-ai/langsmith-sdk/compare/v0.7.3...v0.7.4">https://github.com/langchain-ai/langsmith-sdk/compare/v0.7.3...v0.7.4</a></p>
<h2>v0.7.3</h2>
<h2>What's Changed</h2>
<ul>
<li>fix: propagate tracingEnabled to nested traceables by <a
href="https://github.com/hntrl"><code>@​hntrl</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2427">langchain-ai/langsmith-sdk#2427</a></li>
<li>chore(python): openai agents: delay span start for spans without
inputs on start event by <a
href="https://github.com/angus-langchain"><code>@​angus-langchain</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2424">langchain-ai/langsmith-sdk#2424</a></li>
<li>release(py): 0.7.3 by <a
href="https://github.com/angus-langchain"><code>@​angus-langchain</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2428">langchain-ai/langsmith-sdk#2428</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/langchain-ai/langsmith-sdk/compare/v0.7.2...v0.7.3">https://github.com/langchain-ai/langsmith-sdk/compare/v0.7.2...v0.7.3</a></p>
<h2>v0.7.2</h2>
<h2>What's Changed</h2>
<ul>
<li>release(js): 0.5.1 by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2389">langchain-ai/langsmith-sdk#2389</a></li>
<li>fix(js): Remove <a
href="https://github.com/internal"><code>@​internal</code></a> by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2391">langchain-ai/langsmith-sdk#2391</a></li>
<li>release(js): 0.5.2 by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2392">langchain-ai/langsmith-sdk#2392</a></li>
<li>chore(deps-dev): bump openai from 5.8.2 to 6.18.0 in /js by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2378">langchain-ai/langsmith-sdk#2378</a></li>
<li>chore(deps-dev): bump cross-env from 7.0.3 to 10.1.0 in /js by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2379">langchain-ai/langsmith-sdk#2379</a></li>
<li>chore(deps-dev): bump the js-minor-and-patch group in /js with 4
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2376">langchain-ai/langsmith-sdk#2376</a></li>
<li>chore(deps-dev): bump node-fetch from 2.7.0 to 3.3.2 in /js by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2380">langchain-ai/langsmith-sdk#2380</a></li>
<li>Google ADK LangSmith tracing enhancements by <a
href="https://github.com/j-broekhuizen"><code>@​j-broekhuizen</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2394">langchain-ai/langsmith-sdk#2394</a></li>
<li>chore: update dependabot.yml to comply with posture checks by <a
href="https://github.com/jkennedyvz"><code>@​jkennedyvz</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2393">langchain-ai/langsmith-sdk#2393</a></li>
<li>chore(deps): bump cryptography from 46.0.3 to 46.0.5 in /python in
the uv group across 1 directory by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2397">langchain-ai/langsmith-sdk#2397</a></li>
<li>chore(deps-dev): bump the js-minor-and-patch group in /js with 6
updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2398">langchain-ai/langsmith-sdk#2398</a></li>
<li>chore(deps-dev): bump eslint-config-prettier from 8.10.0 to 10.1.8
in /js by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2399">langchain-ai/langsmith-sdk#2399</a></li>
<li>chore(deps): bump packaging from 25.0 to 26.0 in /python by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2403">langchain-ai/langsmith-sdk#2403</a></li>
<li>chore(deps-dev): bump pytest from 8.4.2 to 9.0.2 in /python by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2405">langchain-ai/langsmith-sdk#2405</a></li>
<li>chore(deps): bump the py-minor-and-patch group across 1 directory
with 20 updates by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2406">langchain-ai/langsmith-sdk#2406</a></li>
<li>fix(js): Log Vitest/Jest outputs even if test throws an error by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2408">langchain-ai/langsmith-sdk#2408</a></li>
<li>fix(js): Remove async by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2409">langchain-ai/langsmith-sdk#2409</a></li>
<li>release(js): 0.5.3 by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2410">langchain-ai/langsmith-sdk#2410</a></li>
<li>fix: ignoring p-queue dep by <a
href="https://github.com/jkennedyvz"><code>@​jkennedyvz</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2414">langchain-ai/langsmith-sdk#2414</a></li>
<li>feat(js): add feedback config CRUD and annotation queue rubric items
(closes LSPE-67) by <a
href="https://github.com/bentanny"><code>@​bentanny</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2420">langchain-ai/langsmith-sdk#2420</a></li>
<li>fix(js): Add on_start handler for traceable, use in evaluate by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2421">langchain-ai/langsmith-sdk#2421</a></li>
<li>release(js): 0.5.4 by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2422">langchain-ai/langsmith-sdk#2422</a></li>
<li>feat(python): add feedback config CRUD and annotation queue rubric
items (closes LSPE-67) by <a
href="https://github.com/bentanny"><code>@​bentanny</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2419">langchain-ai/langsmith-sdk#2419</a></li>
<li>feat(python): add exceptions_to_handle to <a
href="https://github.com/traceable"><code>@​traceable</code></a> by <a
href="https://github.com/QuentinBrosse"><code>@​QuentinBrosse</code></a>
in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2423">langchain-ai/langsmith-sdk#2423</a></li>
<li>release(py): 0.7.2 by <a
href="https://github.com/jacoblee93"><code>@​jacoblee93</code></a> in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2426">langchain-ai/langsmith-sdk#2426</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/j-broekhuizen"><code>@​j-broekhuizen</code></a>
made their first contribution in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2394">langchain-ai/langsmith-sdk#2394</a></li>
<li><a href="https://github.com/bentanny"><code>@​bentanny</code></a>
made their first contribution in <a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/pull/2420">langchain-ai/langsmith-sdk#2420</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/1132e6ce6391d08158a93acb5c96b90521ac3230"><code>1132e6c</code></a>
release(py): 0.7.4 (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2441">#2441</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/8c7cc783806e4a6d71300982d58ecb3c9bc658cd"><code>8c7cc78</code></a>
chore: lock dependencies (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2439">#2439</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/62c256ea56fdee0bc539275c749a427e510ded8f"><code>62c256e</code></a>
fix(google-adk): add wrapt dependency (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2436">#2436</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/e32d4c18a681553f47c93350f03dc0a0f0cc4890"><code>e32d4c1</code></a>
release(py): 0.7.3 (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2428">#2428</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/1c51bf881dafaeb01432db629de7cafaabca79dc"><code>1c51bf8</code></a>
chore(python): openai agents: delay span start for spans without inputs
on st...</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/a41bf22dadaea489a156dc06a9d0fbf1a977ff6d"><code>a41bf22</code></a>
fix: propagate tracingEnabled to nested traceables (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2427">#2427</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/3a6e9dac4bf3a940f7ee47e420cc1422f9f4a4b4"><code>3a6e9da</code></a>
release(py): 0.7.2 (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2426">#2426</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/f665e865e7ab7a0ba1de447f2a1cf14c719af00a"><code>f665e86</code></a>
feat(python): add exceptions_to_handle to <a
href="https://github.com/traceable"><code>@​traceable</code></a> (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2423">#2423</a>)</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/565c4a2c5769e698ecffbf7f43131ff9cc467f8d"><code>565c4a2</code></a>
feat(python): add feedback config CRUD and annotation queue rubric items
(clo...</li>
<li><a
href="https://github.com/langchain-ai/langsmith-sdk/commit/e1b1fe13c382371ebe4cffa1b95eba3bf74e2f37"><code>e1b1fe1</code></a>
release(js): 0.5.4 (<a
href="https://redirect.github.com/langchain-ai/langsmith-sdk/issues/2422">#2422</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/langchain-ai/langsmith-sdk/compare/v0.6.0...v0.7.4">compare
view</a></li>
</ul>
</details>
<br />

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: John Kennedy <jkennedyvz@users.noreply.github.com>
2026-06-03 19:51:50 -07:00
..

In-Process Streaming Examples

Runnable examples demonstrating graph.streamEvents(..., { version: "v3" }) — the ergonomic in-process streaming API for LangGraph.

Setup

# From the monorepo root
pnpm install

# Set your API key
export ANTHROPIC_API_KEY=sk-...

Examples

Each example is a self-contained script that can be run with npx tsx.

basic.ts — Protocol event iteration

The simplest starting point. Iterates all ProtocolEvent objects from a tool-calling graph and awaits the final output.

npx tsx src/basic.ts

Shows: for await (const event of run), await run.output

messages.ts — Streaming text tokens

Demonstrates the .messages projection. Each yielded ChatModelStream exposes .text as both an AsyncIterable<string> (for token-by-token streaming) and a PromiseLike<string> (for the full text). Also shows .usage for token counts.

npx tsx src/messages.ts

Shows: run.messages, message.text, message.usage

subgraphs.ts — Recursive subgraph observation

A research pipeline with two sequential subgraphs (researcher → analyst). Shows three ways to observe the subgraph tree:

  1. Flat event stream — all events, dispatched by event.method
  2. Subgraph discovery — run.subgraphs yields SubgraphRunStream per child
  3. Concurrent consumption — messages and subgraphs consumed in parallel
npx tsx src/subgraphs.ts

Shows: run.subgraphs, sub.messages, sub.name, sub.index, recursive walking

custom-reducer.ts — Domain-specific projections

Extends streamEvents(..., { version: "v3" }) with a custom StreamTransformer that counts tool calls and tracks token usage. The transformer is passed via the transformers option; its projections appear on run.extensions.

npx tsx src/custom-reducer.ts

Shows: StreamTransformer, graph.streamEvents(input, { version: "v3", transformers: [...] }), run.extensions

parallel.ts — Concurrent projection consumption

All projections on GraphRunStream share local stream channels, so multiple for await loops can run concurrently without interference. This example streams messages, counts state snapshots, and counts raw protocol events in parallel via Promise.all.

npx tsx src/parallel.ts

Shows: Promise.all([run.messages, run.values, run]), independent cursors

human-in-the-loop.ts — Interrupt, inspect, resume

Demonstrates the streamEvents(..., { version: "v3" }) interrupt/resume lifecycle using a planner → approval → executor graph. Turn 1 runs until interrupt() is called; the example inspects run.interrupted and run.interrupts, then resumes with Command({ resume }) in turn 2.

npx tsx src/human-in-the-loop.ts

Shows: interrupt(), run.interrupted, run.interrupts, Command({ resume }), multi-turn streamEvents(..., { version: "v3" })

a2a.ts — A2A protocol over a deployed server

End-to-end deployment example for custom stream transformers. The research pipeline is compiled with an A2A transformer (createA2ATransformer) that emits A2A-formatted status updates and artifacts. The graph is deployed via the LangGraph dev server, and the SDK client subscribes to the custom channel to receive only A2A events.

npx tsx src/a2a.ts

Shows: .compile({ transformers: [createA2ATransformer] }), streamStateV2(), SDK client.runs.stream(), streamMode: ["custom"]

Agents

The example agents live in src/agents/ and src/a2a/:

Agent File Description
Simple tool graph agents/simple-tool-graph.ts Single ReAct loop with search + calculator
Research pipeline agents/research-pipeline.ts Two sequential subgraphs with separate tools
Approval graph agents/approval-graph.ts Planner → human approval → executor with interrupt/resume
A2A research a2a/agent.ts Research pipeline with A2A stream transformer at compile time

API Surface

All examples use the GraphRunStream returned by graph.streamEvents(..., { version: "v3" }):

const run = await graph.streamEvents(input, { ...options, version: "v3" });

// Iterate all protocol events
for await (const event of run) { ... }

// Stream AI messages with text/reasoning/usage projections
for await (const msg of run.messages) {
  for await (const token of msg.text) { process.stdout.write(token); }
  const fullText = await msg.text;
  const usage = await msg.usage;
}

// Observe subgraphs recursively
for await (const sub of run.subgraphs) {
  console.log(sub.name, sub.path);
  for await (const msg of sub.messages) { ... }
}

// Final output
const state = await run.output;

// State snapshots per step
for await (const snapshot of run.values) { ... }

// Messages from a specific node
for await (const msg of run.messagesFrom("agent")) { ... }

// Custom transformers
const run = await graph.streamEvents(input, {
  version: "v3",
  transformers: [myTransformer],
});
const custom = await run.extensions.myProjection;

// Human-in-the-loop
const run1 = await graph.streamEvents(input, { ...config, version: "v3" });
for await (const msg of run1.messages) { ... }
await run1.output;
if (run1.interrupted) {
  console.log(run1.interrupts);
  const run2 = await graph.streamEvents(
    new Command({ resume: userDecision }),
    { ...config, version: "v3" }
  );
}

Coming Soon

Additional examples will be added for:

  • createAgentAgentRunStream with typed run.toolCalls
  • createDeepAgentDeepAgentRunStream with run.subagents
  • Cancellation — run.abort(), AbortSignal passthrough