-
Notifications
You must be signed in to change notification settings - Fork 480
Fix #759: Add documentation for invalid model name error #762
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
Open
Solventerritory
wants to merge
15
commits into
google-gemini:main
Choose a base branch
from
Solventerritory:gemini
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
319e268
# Fix: Image Encoding Compatibility Issues with Python 3.10+
Solventerritory ad41c4d
Update google/generativeai/types/content_types.py
Solventerritory 84778aa
Update google/generativeai/types/content_types.py
Solventerritory 5f7ddd8
modified test_image_issue.py to fix image loading bug in edge cases.
Solventerritory fdd4e8c
Fix #759: Add documentation for invalid model name error
Solventerritory 95afcb4
Update ISSUE_759_SUMMARY.md
Solventerritory c6fc66d
Update ISSUE_759_RESOLUTION.md
Solventerritory c9598e7
Update verify_models.py
Solventerritory 9494332
Update verify_models.py
Solventerritory 36afa92
Update verify_models.py
Solventerritory 1170469
Update verify_models.py
Solventerritory 15b450f
Update verify_models.py
Solventerritory 8d55e7f
Merge branch 'gemini' of https://github.com/Solventerritory/deprecate…
Solventerritory a9af2cf
IMAGE_ENCODING_FIX
Solventerritory c4361f0
ISSUE_759_RESOLUTION
Solventerritory File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # Issue #759 Resolution: Gemini-3-Pro-Preview Error | ||
|
|
||
| ## 🎯 Quick Answer | ||
|
|
||
| The model name **"Gemini-3-Pro-Preview" does not exist**. Use `gemini-2.0-flash` instead. | ||
|
|
||
| ## 📚 Documentation Files | ||
|
|
||
| This directory contains complete resolution documentation for Issue #759: | ||
|
|
||
| 1. **[ISSUE_759_SUMMARY.md](./ISSUE_759_SUMMARY.md)** - Start here! | ||
| - Executive summary | ||
| - Quick fix guide | ||
| - All resources in one place | ||
|
|
||
| 2. **[ROOCODE_FIX_GUIDE.md](./ROOCODE_FIX_GUIDE.md)** - For Roocode users | ||
| - Step-by-step fix instructions | ||
| - Troubleshooting tips | ||
| - Valid model names reference | ||
|
|
||
| 3. **[ISSUE_759_RESOLUTION.md](./ISSUE_759_RESOLUTION.md)** - Technical details | ||
| - Root cause analysis | ||
| - Migration guide to new SDK | ||
| - For developers integrating Gemini API | ||
|
|
||
| 4. **[verify_models.py](./verify_models.py)** - Verification tool | ||
| - Test your API key | ||
| - List available models | ||
| - Verify connectivity | ||
|
|
||
| ## ⚡ Quick Fix | ||
|
|
||
| ### For Roocode Users (VSCode Extension) | ||
|
|
||
| 1. Open VSCode Settings: `Ctrl+,` or `Cmd+,` | ||
| 2. Search: "Roocode" | ||
| 3. Find model name setting | ||
| 4. Change to: `gemini-2.0-flash` | ||
| 5. Save and reload VSCode | ||
|
|
||
| ### Valid Model Names | ||
|
|
||
| ✅ Use these: | ||
| - `gemini-2.0-flash` (recommended) | ||
| - `gemini-1.5-pro` | ||
| - `gemini-1.5-flash` | ||
|
|
||
| ❌ Don't use: | ||
| - `Gemini-3-Pro-Preview` (doesn't exist!) | ||
|
|
||
| ## 🔧 Test Your Setup | ||
|
|
||
| ```bash | ||
| # Set your API key | ||
| export GEMINI_API_KEY="your-api-key" | ||
|
|
||
| # Run verification script | ||
| python verify_models.py | ||
| ``` | ||
|
|
||
| ## ⚠️ Important Notice | ||
|
|
||
| This SDK is **deprecated** and will reach End-of-Life on **November 30, 2025**. | ||
|
|
||
| **Migrate to new SDK:** | ||
| - Repository: https://github.com/googleapis/python-genai | ||
| - Migration Guide: https://ai.google.dev/gemini-api/docs/migrate | ||
|
|
||
| ## 📖 Additional Resources | ||
|
|
||
| - **Get API Key:** https://aistudio.google.com/app/apikey | ||
| - **Documentation:** https://ai.google.dev/gemini-api/docs | ||
| - **Community Forum:** https://discuss.ai.google.dev/c/gemini-api/4 | ||
|
|
||
| ## 🤝 Contributing | ||
|
|
||
| Found this helpful? Have suggestions? Please contribute to the new SDK: | ||
| - https://github.com/googleapis/python-genai | ||
|
|
||
| --- | ||
|
|
||
| **Issue:** #759 | ||
| **Status:** ✅ Resolved | ||
| **Type:** Configuration Error (Invalid Model Name) | ||
| **Date:** December 12, 2024 | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| # Issue #759 Resolution: "Requests Error" with Roocode VSCode Extension | ||
|
|
||
| ## Problem Summary | ||
|
|
||
| Users attempting to use "Gemini-3-Pro-Preview" with the Roocode VSCode extension are encountering "Requests Error" / "Service Unavailable" errors. | ||
|
|
||
| ## Root Causes | ||
|
|
||
| ### 1. Invalid Model Name | ||
| The model name **"Gemini-3-Pro-Preview"** does not exist. This is causing the API requests to fail. | ||
|
|
||
| **Valid model names include:** | ||
| - `gemini-1.5-flash` (recommended for most use cases) | ||
| - `gemini-1.5-flash-latest` | ||
| - `gemini-1.5-pro` | ||
| - `gemini-1.5-pro-latest` | ||
| - `gemini-2.0-flash` (newest model) | ||
| - `gemini-2.0-flash-001` | ||
|
|
||
| ### 2. Deprecated SDK | ||
| This repository (`google-gemini/deprecated-generative-ai-python`) is **deprecated** and will reach End-of-Life on **November 30, 2025**. | ||
Solventerritory marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ## Solutions | ||
|
|
||
| ### Immediate Fix for Roocode Users | ||
|
|
||
| If you're using the Roocode VSCode extension: | ||
|
|
||
| 1. **Update your model configuration in Roocode settings:** | ||
| - Open VSCode Settings (Ctrl/Cmd + ,) | ||
| - Search for "Roocode" | ||
| - Find the model name setting | ||
| - Change `Gemini-3-Pro-Preview` to a valid model name like: | ||
| - `gemini-2.0-flash` (newest, recommended) | ||
| - `gemini-1.5-pro` (more capable for complex tasks) | ||
| - `gemini-1.5-flash` (faster, good for most tasks) | ||
|
|
||
| 2. **Verify your API key is valid:** | ||
| - Ensure your Google AI API key is correctly configured | ||
| - Get your API key from: https://aistudio.google.com/app/apikey | ||
|
|
||
| ### Long-term Recommendation: Migrate to New SDK | ||
|
|
||
| All users should migrate to the **new [Google Generative AI SDK](https://github.com/googleapis/python-genai)**: | ||
|
|
||
| 1. **Uninstall the old SDK:** | ||
| ```bash | ||
| pip uninstall google-generativeai | ||
| ``` | ||
|
|
||
| 2. **Install the new SDK:** | ||
| ```bash | ||
| pip install google-genai | ||
| ``` | ||
|
|
||
| 3. **Update your code:** | ||
|
|
||
| **Old SDK (deprecated):** | ||
| ```python | ||
| import google.generativeai as genai | ||
|
|
||
| genai.configure(api_key="YOUR_API_KEY") | ||
| model = genai.GenerativeModel("gemini-1.5-flash") | ||
| response = model.generate_content("Hello") | ||
| ``` | ||
|
|
||
| **New SDK (recommended):** | ||
| ```python | ||
| from google import genai | ||
|
|
||
| client = genai.Client(api_key="YOUR_API_KEY") | ||
| response = client.models.generate_content( | ||
| model="gemini-1.5-flash", | ||
| contents="Hello" | ||
| ) | ||
| ``` | ||
|
|
||
| 4. **Full migration guide:** | ||
| - https://ai.google.dev/gemini-api/docs/migrate | ||
|
|
||
| ## How to List Available Models | ||
|
|
||
| To see all currently available models, use: | ||
|
|
||
| ```python | ||
| import google.generativeai as genai | ||
|
|
||
| genai.configure(api_key="YOUR_API_KEY") | ||
|
|
||
| print("Models that support generateContent:") | ||
| for m in genai.list_models(): | ||
| if 'generateContent' in m.supported_generation_methods: | ||
| print(f" - {m.name}") | ||
| ``` | ||
|
|
||
| Or via REST API: | ||
| ```bash | ||
| curl https://generativelanguage.googleapis.com/v1beta/models?key=YOUR_API_KEY | ||
| ``` | ||
|
|
||
| ## For Third-Party Tool Developers (Roocode, etc.) | ||
|
|
||
| If you're developing tools that integrate with Google's Gemini API: | ||
|
|
||
| 1. **Implement model name validation** before making API requests | ||
| 2. **Provide users with a dropdown** of valid model names instead of free-text input | ||
| 3. **Migrate to the new Google Gen AI SDK** for better long-term support | ||
| 4. **Handle API errors gracefully** with clear user-facing error messages | ||
| 5. **Keep model list updated** as new models are released | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| - **New SDK Repository:** https://github.com/googleapis/python-genai | ||
| - **Migration Guide:** https://ai.google.dev/gemini-api/docs/migrate | ||
| - **Gemini API Documentation:** https://ai.google.dev/gemini-api/docs | ||
| - **Community Forum:** https://discuss.ai.google.dev/c/gemini-api/4 | ||
| - **Get API Key:** https://aistudio.google.com/app/apikey | ||
|
|
||
| ## Status | ||
|
|
||
| - **Issue Type:** Configuration Error (Invalid Model Name) | ||
| - **Affected Component:** Third-party VSCode extension (Roocode) | ||
| - **SDK Status:** Deprecated (EOL: November 30, 2025) | ||
| - **Recommended Action:** Update model name + Migrate to new SDK | ||
|
|
||
| --- | ||
|
|
||
| **Note:** This issue is not a bug in the SDK itself, but rather a configuration issue in the third-party Roocode extension using an invalid model name. Since this SDK is deprecated, users should migrate to the new Google Generative AI SDK for continued support. | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.