Skip to content

Add GoogleModel support#727

Draft
szykol wants to merge 1 commit intodevelopfrom
skolton/gemini-support
Draft

Add GoogleModel support#727
szykol wants to merge 1 commit intodevelopfrom
skolton/gemini-support

Conversation

@szykol
Copy link
Copy Markdown
Collaborator

@szykol szykol commented Apr 17, 2026

This PR adds support to Google Models via:

  • Gemini API
  • VertexAI

The actual backend used depends on the parameters passed to GoogleModel

@szykol szykol force-pushed the skolton/gemini-support branch 2 times, most recently from 6b8ce98 to 52cbd48 Compare April 17, 2026 11:43
This PR adds support to Google Models via:
- Gemini API
- VertexAI

The actual backend used depends on the parameters passed to GoogleModel
@szykol szykol force-pushed the skolton/gemini-support branch from 52cbd48 to 8bcd6bf Compare April 17, 2026 12:10
@szykol
Copy link
Copy Markdown
Collaborator Author

szykol commented Apr 23, 2026

update:

Those changes were tested with Gemini models through Gemini API.
The thought signature issue that we had when using Gemini models through OpenAI compatible API is (partially) gone now.
However, our SDK does not preserve the though signatures in it's own types and this works only because the langchain-google-genai package uses dummy thought signatures when original ones (generated by the model) are missing.

I imagine we're gonna need to include the original though signatures when passing new messages to the Gemini model, but this requires a couple of changes to the SDK code - mainly how we handle content of AIMessage. Currently we're dumping everything to string, but some model providers return content blocks instead of strings there. Gemini models include thought signatures inside those content blocks (if not calling tools). If calling tools, the though signature is stored in the additional_kwargs field of AIMessage.

Once we'll fix handling content in AIMessages we can continue with this PR. It's already in progress.

@Ickerday Ickerday marked this pull request as draft April 23, 2026 13:30
@Ickerday Ickerday self-requested a review April 23, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants