Skip to content

Conversation

@haroon0x
Copy link

@haroon0x haroon0x commented Oct 26, 2025

Description

Implement logprobs support in chat_models.py to ChatGoogleGenerativeAI

Relevant issues

Fixes #718

Type

🆕 New Feature
✅ Test

Changes(optional)

Files changed chat_models.py and test_chat_models.py

Testing(optional)

Added test_logprobs function in test_chat_models.py

Note(optional)

Copy link

@hossam1522 hossam1522 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@haroon0x haroon0x changed the title feat(genai) : Add logprobs support to ChatGoogleGenerativeAI feat(genai): Add logprobs support to ChatGoogleGenerativeAI Oct 26, 2025
@mdrxy mdrxy changed the title feat(genai): Add logprobs support to ChatGoogleGenerativeAI feat(genai): add logprobs support Nov 10, 2025
@mdrxy
Copy link
Collaborator

mdrxy commented Nov 10, 2025

I also think we ought to mention the instability of the param

https://discuss.ai.google.dev/t/logprobs-is-not-enabled-for-gemini-models/107989/15
vercel/ai#5418

I can't get newer Gemini models (2.5) to return logprobs via the genai API either

@mdrxy mdrxy marked this pull request as draft November 13, 2025 06:49
@haroon0x haroon0x marked this pull request as ready for review November 14, 2025 16:16
@haroon0x
Copy link
Author

This is what i got when i tried gemini-2.5-flash
langchain_google_genai.chat_models.ChatGoogleGenerativeAIError: Invalid argument provided to Gemini: 400 Logprobs is not enabled for models/gemini-2.5-flash

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.

Logprobs support

3 participants