Skip to content

Conversation

@bjoaquinc
Copy link
Contributor

@bjoaquinc bjoaquinc commented Oct 1, 2025

📝 Summary

This PR fixes the issue of premature client closing for all gemini models which is a blocking issue for using gemini with chat.

Screenshot 2025-10-01 at 8 06 50 PM

🔍 Description of Changes

  • Add _client variable in GoogleProvider
  • Update get_client() to cache client when first invoked, then reuse the cached client to ensure that between stream iters, the same GoogleClient is used and and the client will not be closed prematurely.
  • Also add ignore to return type error for google since it doesn't affect functionality but throws a type error.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

@vercel
Copy link

vercel bot commented Oct 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Oct 1, 2025 7:25pm

@mscolnick mscolnick merged commit ce78516 into marimo-team:main Oct 1, 2025
27 of 37 checks passed
@bjoaquinc bjoaquinc deleted the gemini-bug-fix branch October 1, 2025 21:20
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