Fixes token usage in streamed responses from Google and Anthropic
LangChain fixes token usage in streamed responses from Google and Anthropic.
Patch Changes #11433 `bc88b75` Thanks @jackjin1997! - Fix Vertex AI endpoint routing for multi-region locations such as `eu` and `us`. #11606 `194a063` Thanks @thushanth-bengre-langchain! - fix: allowlist JSON Schema keywords for Gemini function/response schemas instead of denylisting, fixing `propertyNames`/`exclusiveMinimum`/etc. 400s (#8584) #11611 `c9ae847` Thanks @thushanth-bengre-langchain! - fix(google): set `toolConfig.includeServerSideToolInvocations` when mixing built-in and function-declaration tools, which Gemini otherwise rejects with a 400 #11616 `35368db` Thanks @thushanth-bengre-langchain! - fix(google): surface `groundingMetadata`/`groundingSupport`/`citationMetadata` on `.stream()` and `.streamEvents()`, matching what `.invoke()` already returns #11603 `fec9cd8` Thanks @thushanth-bengre-langchain! - fix(core): build streaming `llmOutput.tokenUsage` from the fully-accumulated chunk instead of whichever individual chunk's `usage_metadata` arrived last Affects both core streaming paths — `.stream()`/`.streamEvents()` (`_streamIterator`) and `.invoke()`/`.generate()` when a streaming-preferring callback is attached (`_generateWithCache`'s `hasStreamingHandler`…
- github.comLangChain (JS) — google v0.2.6primary
- github.comLangChain (JS) — core v1.2.11
§ how this story moved
- primary — LangChain (JS) — Releases publishes the launch post.
- LangChain (JS) — Releases picks up coverage.