unstale

npm / @langchain/google-genai

@langchain/google-genai

What changed in @langchain/google-genai 0.3 to 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.

3 breaking1 security7 new APIs and options1 performance6 behavior and defaults11 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.1.1 on npm

@langchain/google-genai 223 changes

Breaking changes 3

  • Non-streaming calls throw a typed, catchable error when a Gemini candidate has no content, rather than silently returning empty content or an empty generations array.

    2.3.0release notes

  • invoke() throws ModelAbortError with accumulated partialOutput when aborted during streaming with streaming callback handlers.

    2.1.14release notes

  • When includeThoughts is enabled, thinking and text content are returned in separate blocks.

    2.1.8release notes

New APIs and options 5

  • Adds the outputDimensionality parameter to GoogleGenerativeAIEmbeddings, allowing developers to specify the output dimensionality.

    2.3.2release notes

  • ChatGoogleGenerativeAI accepts GEMINI_API_KEY as a fallback environment variable.

    2.3.0release notes

  • Structured output now supports standard schemas.

    2.1.24release notes

  • Custom headers can now be added when using ChatGoogleGenerativeAI.

    2.1.0release notes

  • createAgent now supports custom agent names.

    2.1.0release notes

Performance 1

  • Stream chunk aggregation is optimized and redundant sorting is removed, improving performance.

    2.1.11release notes

Behavior and default changes 4

  • When LANGSMITH_GATEWAY is set, supported Gemini chat models route requests through the gateway's Gemini path, unless explicit baseUrl/endpoint, apiKey, or Vertex AI configuration suppresses routing.

    2.3.0release notes

  • Adds native event conversion for streamEvents.

    2.2.0release notes

  • Runnable traces now include package version metadata, making version information available in LangSmith trace metadata.

    2.1.21release notes

  • Model profiles were updated, which may affect decisions based on profile information.

    2.1.19release notes

Fixes and other changes 10

  • The streaming path safely skips a contentless chunk instead of throwing a raw TypeError.

    2.3.0release notes

  • Google providers now support ContentBlock.Multimodal types.

    2.1.26release notes

  • Thinking content blocks now round-trip in multi-turn conversations.

    2.1.26release notes

  • Fixes optional chaining for candidateContent in reduce.

    2.1.25release notes

  • Empty strings in enum values are validated to provide clear errors instead of cryptic runtime errors from the Gemini API.

    2.1.14release notes

  • Abort signals are checked and propagated for invoke and streaming operations, enabling cancellation and allowing fallback chains to proceed when a runnable is aborted.

    2.1.14release notes

  • stream() throws a regular AbortError when aborted, because chunks have already been yielded to the caller.

    2.1.14release notes

  • ChatGoogleGenerativeAI with outputVersion: "v1" now handles tool_call content blocks, avoiding an "Unknown content type tool_call" error with standard LangChain tool call blocks.

    2.1.12release notes

  • Reasoning tokens are now properly elevated.

    2.1.8release notes

  • Access around custom content parts is now safe.

    2.1.0release notes

@langchain/google-genai 15 changes

New APIs and options 2

  • ChatGoogleGenerativeAI now supports thinkingConfig.

    1.0.3release notes

  • Usage metadata now includes cached token counts.

    1.0.3release notes

Behavior and default changes 2

  • Usage metadata now includes tier-based token counts.

    1.0.3release notes

  • Adds thought signature support for function calling.

    1.0.2release notes

Fixes and other changes 1

  • Fixes a bug with thought signatures during streaming.

    1.0.3release notes

@langchain/google-genai 0.31 changes

Security 1