-
-
Notifications
You must be signed in to change notification settings - Fork 869
Deprecate google-generativeai in favor of google-genai #1673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Warns users to migrate to from_genai or from_provider - Provides clear migration examples - Part of deprecating google-generativeai in favor of google-genai 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Migrate generative-ai provider to use google-genai - Migrate vertexai provider to use google-genai with vertexai=True - Add deprecation warning to from_vertexai function - All Google providers now use the unified google-genai SDK 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Update Google integration docs to use google-genai instead of google-generativeai - Update Vertex AI docs with migration guide - Add clear migration instructions for both Gemini and Vertex AI users - Update all code examples to use from_provider or new SDK 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Remove google-generativeai from pyproject.toml dependencies - Keep from_gemini import for backward compatibility with deprecation comment - Part of migrating to unified google-genai SDK 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed everything up to d8142d2 in 1 minute and 56 seconds. Click for details.
- Reviewed
515
lines of code in8
files - Skipped
0
files when reviewing. - Skipped posting
15
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. docs/integrations/google.md:7
- Draft comment:
Updated heading to 'Google GenAI SDK' clearly reflects the new migration target. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. docs/integrations/google.md:16
- Draft comment:
Installation command updated to use [google-genai] extra; migration is well documented. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
3. docs/integrations/google.md:310
- Draft comment:
Migration guide examples (old vs new) are clear and provide useful code snippets. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
4. docs/integrations/vertex.md:7
- Draft comment:
The added warning block effectively notifies users about deprecation for direct vertexai usage. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
5. docs/integrations/vertex.md:37
- Draft comment:
Setting environment variables for project and location is clearly demonstrated. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
6. docs/integrations/vertex.md:225
- Draft comment:
The Vertex AI migration section comprehensively shows both 'from_provider' and 'from_genai' approaches. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
7. instructor/__init__.py:56
- Draft comment:
Deprecated 'from_gemini' is noted; consider adding a similar inline comment for 'from_vertexai' if not already flagged. - Reason this comment was not posted:
Confidence changes required:33%
<= threshold85%
None
8. instructor/auto_client.py:205
- Draft comment:
Properly pops 'vertexai' from kwargs to avoid duplicate parameter passing when initializing the client. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
9. instructor/auto_client.py:211
- Draft comment:
Removal of explicit 'model' parameter in from_genai call is appropriate since the client is already configured with model. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
10. instructor/auto_client.py:367
- Draft comment:
Retrieving 'project' and 'location' from kwargs or environment and raising a clear error if missing is robust. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
11. instructor/auto_client.py:380
- Draft comment:
The 'generative-ai' branch consistently instantiates the client for non-vertex use with proper error messaging. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
12. instructor/client_gemini.py:32
- Draft comment:
Deprecation warning in 'from_gemini' clearly instructs users on how to migrate to the new API. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
13. instructor/client_vertexai.py:142
- Draft comment:
Deprecation warning in 'from_vertexai' is comprehensive and offers migration samples. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
14. pyproject.toml:85
- Draft comment:
Removal of 'google-generativeai' dependency and update of extras is correct for the migration. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
15. uv.lock:1835
- Draft comment:
Lock file updates reflect the removal of 'google-generativeai'; ensure consistency with dependency upgrades. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
Workflow ID: wflow_1wTwuzeWRKHbZ36j
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- Update test_simple_types.py to use from_provider - Update test_modes.py to use new SDK and modes - Update util.py with new modes (GENAI_TOOLS, GENAI_STRUCTURED_OUTPUTS) - Fix auto_client.py to properly pass API key from environment - Create new test_genai directory with basic tests - Update conftest.py to import google-genai Note: Tests require a valid GOOGLE_API_KEY to run 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed d5af543 in 1 minute and 49 seconds. Click for details.
- Reviewed
231
lines of code in6
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_gemini/test_modes.py:23
- Draft comment:
For consistency with migration examples, consider using instructor.from_provider instead of instructor.from_genai here. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
Workflow ID: wflow_KpbmCRNhgrpGwyWd
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
vertexai_flag = kwargs.pop("vertexai", False) | ||
|
||
# Get API key from kwargs or environment | ||
api_key = kwargs.pop("api_key", os.environ.get("GOOGLE_API_KEY")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API key extraction and model assignment are duplicated in multiple Google provider branches. Consider refactoring this logic into a helper function.
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
instructor | 24378ec | Commit Preview URL | Jul 08 2025, 01:48 AM |
…vider - Remove google-generativeai imports from all test files - Update tests to use instructor.from_provider() instead of from_gemini() - Update GitHub Actions to include GEMINI_API_KEY environment variable - Remove google-generativeai optional dependency from pyproject.toml - Update uv.lock after removing google-generativeai dependency This completes the migration of test files to the new google-genai SDK using the recommended from_provider approach for better consistency. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 1e57441 in 1 minute and 28 seconds. Click for details.
- Reviewed
1271
lines of code in27
files - Skipped
0
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. .github/workflows/test.yml:38
- Draft comment:
Ensure the GEMINI_API_KEY secret is properly configured in CI. This addition is correct but confirm that it's available in your secrets. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
2. pyproject.toml:155
- Draft comment:
Removal of the google-generativeai dependency is correct. Verify that migration docs and tests are updated to reference the new google-genai package. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. tests/llm/test_gemini/evals/test_classification_enums.py:29
- Draft comment:
Switching from instructor.from_gemini to instructor.from_provider simplifies client instantiation. Note that parameterization via product() was removed—ensure all necessary model/mode variations are still covered. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
4. tests/llm/test_gemini/test_patch.py:14
- Draft comment:
Inconsistent usage detected: some tests use instructor.from_genai while others use instructor.from_provider. Consider unifying these client instantiation methods for consistency. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold85%
None
5. tests/llm/test_vertexai/test_deprecated_async.py:4
- Draft comment:
Deprecation warning tests correctly capture the '_async' deprecation. Confirm that related documentation is updated to reflect the change to 'use_async'. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold85%
None
6. uv.lock:1087
- Draft comment:
Lockfile updates correctly remove google-generativeai entries in favor of google-genai. Ensure that future dependency changes trigger a regeneration of uv.lock. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold85%
The comment is about a lockfile update, which is related to dependencies. The rules specify not to comment on dependency changes unless it's about documentation or tests. This comment doesn't mention either, so it should be removed.
7. tests/llm/test_gemini/test_retries.py:29
- Draft comment:
It looks like there might be a typo in the test message on line 29: "Extractjason is 12
". Did you mean to use "json" instead of "jason"? - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_QC9Ev7tXjbInBRGl
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
…rativeai - Update installation guides to recommend google-genai package - Update modes-comparison.md to use GENAI_TOOLS and GENAI_STRUCTURED_OUTPUTS - Add deprecation warning to gemini_schema property in function_calls.py - Update remaining test files to use google-genai imports - Add fallback imports for backward compatibility in utils.py This completes the documentation updates for the google-genai migration. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 59d7393 in 1 minute and 42 seconds. Click for details.
- Reviewed
235
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. instructor/function_calls.py:159
- Draft comment:
The gemini_schema property now emits a deprecation warning and falls back to importing from google.generativeai.types. Consider attempting to import from google.genai.types first (if available) to align closer with the new SDK and update the docstring to explain this fallback behavior. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
2. instructor/utils.py:870
- Draft comment:
Good use of a try/except block to import HarmCategory and HarmBlockThreshold from google.genai.types with a fallback to the old package. Ensure that both SDK interfaces remain fully compatible. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold85%
This comment is purely informative and asks the PR author to ensure compatibility, which violates the rules. It does not provide a specific suggestion or point out a specific issue.
3. tests/llm/test_gemini/test_multimodal_content.py:17
- Draft comment:
Test has been updated to use instructor.from_provider with mode GENAI_STRUCTURED_OUTPUTS. Ensure additional tests cover the full functionality of the new google-genai SDK. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 85% The comment has two parts: 1) An observation about the code change (which is just stating what's visible), and 2) A suggestion to "ensure" more test coverage. This violates the rule about not asking authors to "ensure" things. Additionally, the comment about SDK coverage is speculative and would require knowledge of the full codebase to evaluate. The comment might be pointing to a legitimate concern about test coverage for a new SDK integration. Missing test coverage could lead to bugs. While test coverage is important, this comment doesn't provide specific, actionable feedback about what tests are missing. It's the type of speculative "ensure that..." comment that the rules explicitly say to avoid. The comment should be deleted as it combines a non-useful observation of visible changes with a speculative request to "ensure" more testing.
4. instructor/function_calls.py:327
- Draft comment:
The assertion in parse_genai_tools enforcing a single non-thought part is strict. Confirm that this behavior aligns with expected use cases and update the error message if future support for multiple function calls is planned. - Reason this comment was not posted:
Confidence changes required:70%
<= threshold85%
None
5. docs/learning/getting_started/installation.md:57
- Draft comment:
The installation instructions now reference 'instructor[google-genai]' for Google/Gemini. This correctly reflects the new dependency. Double-check that all related migration examples are updated consistently. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold85%
This comment is purely informative and asks the PR author to double-check something, which violates the rules. It does not provide a specific code suggestion or request for a test.
6. tests/llm/test_gemini/test_multimodal_content.py:16
- Draft comment:
Typo: The function name 'test_audio_compatability_list' contains a typo. Consider renaming it to 'test_audio_compatibility_list' to correct the spelling. - Reason this comment was not posted:
Comment was on unchanged code.
7. tests/llm/test_gemini/test_multimodal_content.py:45
- Draft comment:
Typo: In the function nametest_audio_compatability_multiple_messages
, "compatability" should be spelled "compatibility". - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_ThWeC0KfsNvkwlE9
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- Update test_modes.py to use from_provider and fix model parameter - Update test_stream.py to use from_provider - All tests now properly use the new google-genai approach 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
These files still need to be migrated to use from_provider 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 3f3d124 in 54 seconds. Click for details.
- Reviewed
426
lines of code in7
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_gemini/test_modes.py:22
- Draft comment:
Migration looks good – using 'from_provider' with the formatted provider string. The change from the legacy SDK is correctly applied. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. tests/llm/test_gemini/test_stream.py:18
- Draft comment:
The local variable 'model' shadows the test parameter 'model'. Consider renaming it (e.g., to 'response') for clarity. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold85%
None
Workflow ID: wflow_eIQzuaeCyixEI3xQ
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- Changed all instances of instructor.from_genai to instructor.from_provider in test files. - Deleted test_long_prompt.py and test_retries.py as they are no longer needed. - Updated util.py to reflect the new model version. - Ensured all tests are aligned with the latest google-genai SDK approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 12c80b7 in 2 minutes and 36 seconds. Click for details.
- Reviewed
342
lines of code in8
files - Skipped
0
files when reviewing. - Skipped posting
6
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_genai/test_format.py:6
- Draft comment:
New imports from the google-genai SDK (genai and types) have been added. Confirm these meet migration requirements and don’t conflict with other usages. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. tests/llm/test_genai/test_invalid_schema.py:102
- Draft comment:
A hard-coded provider string 'google/gemini-2.0-flash' is used here while the util file now defines models as 'gemini-2.5-flash'. Consider aligning these for consistency unless intentionally testing legacy behavior. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
3. tests/llm/test_genai/test_multimodal.py:49
- Draft comment:
Multimodal tests have been updated to use 'instructor.from_provider' and correctly pass autodetect settings for images, PDF, and audio. Ensure that all new integrations (e.g., PDFWithGenaiFile) work as expected with the new SDK. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
4. tests/llm/test_genai/test_simple.py:19
- Draft comment:
Simple extraction tests now use 'from_provider' with the proper 'async_client' flag for sync and async modes. This update is consistent with the migration and looks correct. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
5. tests/llm/test_genai/test_stream.py:19
- Draft comment:
Stream-based tests have been updated to use 'from_provider' with the async_client flag. Verify that both streaming and iterable responses maintain expected behavior. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
6. tests/llm/test_genai/util.py:3
- Draft comment:
The models constant has been updated to 'gemini-2.5-flash'. Ensure that tests using hard-coded provider strings (e.g., 'google/gemini-2.0-flash') are updated if needed for consistency. - Reason this comment was not posted:
Confidence changes required:80%
<= threshold85%
None
Workflow ID: wflow_34UPlliYO9M5s805
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed ea366ed in 44 seconds. Click for details.
- Reviewed
10
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_vertexai/util.py:3
- Draft comment:
Updated model version to 'gemini-2.5-flash'. Ensure all tests and mocks expecting the old model 'gemini-2.0-flash' are updated accordingly. - Reason this comment was not posted:
Comment looked like it was already resolved.
Workflow ID: wflow_FESE9Uzjbwc9rt2C
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- Use dynamic environment variable approach for provider tests - Remove duplicate GOOGLE_API_KEY/GEMINI_API_KEY entries - Keep XAI_API_KEY from main branch - Fix merge conflicts in auto_client.py for genai provider - Use from_genai with model parameter consistently 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed dd816e0 in 1 minute and 0 seconds. Click for details.
- Reviewed
26
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. pyproject.toml:5
- Draft comment:
Version bump updated to 1.10.0. Ensure accompanying changelog and version tags are updated. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
2. uv.lock:5
- Draft comment:
Lock file version updated to 1.10.0. Verify consistency with pyproject.toml. - Reason this comment was not posted:
Confidence changes required:0%
<= threshold85%
None
Workflow ID: wflow_wt5dqh1fUtrORq8z
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
- Changed instances of instructor.from_gemini to instructor.from_provider in test_multimodal_content.py. - Updated file handling logic to accommodate changes in the google-genai API. - Added new evals directory and initialized __init__.py. - Updated test_extract_users.py to reflect the new model parameter format. These changes align the tests with the latest google-genai SDK approach.
- The file test_distil.py has been deleted to streamline the test suite and remove outdated tests. This change helps maintain focus on relevant and current testing practices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 24378ec in 49 seconds. Click for details.
- Reviewed
107
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/test_distil.py:1
- Draft comment:
The entire tests file was removed. Ensure that the distil functionality is still tested (via migrated tests or new tests using google-genai) to avoid losing coverage. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
Workflow ID: wflow_7LlmfRPFcYCaZVUM
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important
Looks good to me! 👍
Reviewed 375e639 in 1 minute and 41 seconds. Click for details.
- Reviewed
92
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
5
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. tests/llm/test_gemini/evals/test_extract_users.py:25
- Draft comment:
Replaced deprecated from_gemini with from_provider. Ensure the provider prefix ('google/') and mode mapping align with the new unified SDK. - Reason this comment was not posted:
Comment looked like it was already resolved.
2. tests/llm/test_gemini/test_multimodal_content.py:16
- Draft comment:
Migrated to use from_provider with model string 'google/gemini-1.5-flash-latest'. Confirm that the mode (GEMINI_JSON) is correctly supported by the new SDK. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold85%
The comment is asking the PR author to confirm if a specific mode is supported by the new SDK. This falls under asking the author to confirm their intention or to double-check things, which is against the rules. Therefore, this comment should not be approved.
3. tests/llm/test_gemini/test_multimodal_content.py:15
- Draft comment:
Function name 'test_audio_compatability_list' contains a typo. Use 'compatibility' instead of 'compatability'. - Reason this comment was not posted:
Comment was on unchanged code.
4. tests/llm/test_gemini/test_multimodal_content.py:36
- Draft comment:
Function name 'test_audio_compatability_multiple_messages' contains a typo. Correct to 'compatibility'. - Reason this comment was not posted:
Comment was on unchanged code.
5. tests/llm/test_gemini/test_multimodal_content.py:36
- Draft comment:
Typo: 'compatability' seems to be misspelled. Consider using 'compatibility'. - Reason this comment was not posted:
Comment was on unchanged code.
Workflow ID: wflow_9VNCEODH69UWVfHi
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
✅ Migrate to google-genai SDK
Summary
This PR completes the migration from the legacy
google-generativeai
package to the new unifiedgoogle-genai
SDK. The new SDK provides a unified interface for both Gemini API and Vertex AI.Changes Made
Core Changes
from_gemini
andfrom_vertexai
functions with clear migration examplesauto_client.py
to usegoogle-genai
for all Google providersgoogle-generativeai
from dependenciesDocumentation Updates
docs/integrations/google.md
with migration guidedocs/integrations/vertex.md
with migration guideTest Migration
tests/llm/test_gemini/
to usegoogle-genai
google.generativeai
tofrom google import genai
instructor.from_provider("google/model-name")
test_distil.py
Migration Examples
For Gemini Users
For Vertex AI Users
Why This Migration Matters
Breaking Changes
from_gemini()
andfrom_vertexai()
now show deprecation warningsinstructor.from_provider()
for all Google AI modelsCloses #1672