Checked other resources
Example Code
Refer to .json files attached to this issue #10561
Error Message and Stack Trace (if applicable)
No response
Description
Using .stream() with ChatGoogle and optionally .concat(), the individual chunks have an additional_kwargs property of originalTextContentBlock that is serialized together with the equivalent text content in content. (Doubling the serialized size in the process).
This happens on both outputFormat v0 and v1.
I couldn't find any consumers of this property, or reference to any explanation in upstream Gemini API docs:
https://www.google.com/search?q=gemini+api+%22originalTextContentBlock%22
https://www.google.com/search?q=langchain+%22originalTextContentBlock%22
https://github.com/search?q=repo%3Alangchain-ai%2Flangchainjs%20originalTextContentBlock&type=code
Therefore, there are only two possible reasons in my mind. Either this property is an unused legacy property from previous iterations of the google provider library, or this property is entirely hallucinated by AI and should be removed.
System Info
Package: @langchain/google
Version: 0.1.9
Companion: @langchain/core 1.1.37 (peerDependency enforced)
Runtime: bun 1.3.11
Platform: Ubuntu 25.10 (Linux 6.17.0-14-generic)
Checked other resources
Example Code
Refer to
.jsonfiles attached to this issue #10561Error Message and Stack Trace (if applicable)
No response
Description
Using
.stream()withChatGoogleand optionally.concat(), the individual chunks have anadditional_kwargsproperty oforiginalTextContentBlockthat is serialized together with the equivalent text content incontent. (Doubling the serialized size in the process).This happens on both
outputFormatv0andv1.I couldn't find any consumers of this property, or reference to any explanation in upstream Gemini API docs:
https://www.google.com/search?q=gemini+api+%22originalTextContentBlock%22
https://www.google.com/search?q=langchain+%22originalTextContentBlock%22
https://github.com/search?q=repo%3Alangchain-ai%2Flangchainjs%20originalTextContentBlock&type=code
Therefore, there are only two possible reasons in my mind. Either this property is an unused legacy property from previous iterations of the
googleprovider library, or this property is entirely hallucinated by AI and should be removed.System Info
Package:
@langchain/googleVersion:
0.1.9Companion:
@langchain/core1.1.37(peerDependency enforced)Runtime:
bun1.3.11Platform:
Ubuntu 25.10 (Linux 6.17.0-14-generic)