github langchain-ai/langchainjs @langchain/google-genai@2.3.0

latest releases: @langchain/neo4j@0.1.16, langchain@1.5.10, @langchain/xai@1.4.9...
4 hours ago

Minor Changes

  • #11400 0e7c765 Thanks @thushanth-bengre-langchain! - fix(google-genai): throw a typed, catchable EmptyContentError instead of silently returning empty content / an empty generations array when a non-streaming call (.invoke(), .generate(), .batch()) gets back a Gemini candidate with no content — whether from an explicit block (safety/recitation filter, rejected prompt) or the model just not producing usable output (a malformed function call, a thinking model exhausting its token budget). The streaming path (.stream()) is unaffected by this behavior change; it now safely skips a contentless chunk instead of throwing a raw TypeError.

Patch Changes

  • #11405 8cfff4d Thanks @hntrl! - Add LangSmith gateway support for Google Gemini (Developer API) models. When LANGSMITH_GATEWAY is set, ChatGoogleGenerativeAI and ChatGoogle (and initChatModel("google-genai:...")) route requests through the gateway's Gemini path, using the gateway key (falling back to LANGSMITH_API_KEY). An explicit baseUrl/endpoint, an explicit apiKey, or a Vertex AI configuration suppress gateway routing. Also adds GEMINI_API_KEY as a fallback env var for ChatGoogleGenerativeAI.

Don't miss a new langchainjs release

NewReleases is sending notifications on new releases.