-
Notifications
You must be signed in to change notification settings - Fork 59.7k
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
Update google models to add gemini-2.0 #5932
Conversation
@fengzai6 is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes in this pull request focus on updating the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (1)app/utils.ts (1)
The addition of "gemini-2.0" to visionKeywords is consistent with the PR objectives and follows the existing pattern. Let's verify that this change correctly identifies the new Gemini 2.0 models as vision models: ✅ Verification successfulVerified: The addition of "gemini-2.0" to visionKeywords is correct and properly used The verification shows that:
🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that isVisionModel correctly identifies new Gemini 2.0 models
# Search for usage of isVisionModel with Gemini 2.0 models
rg -A 3 "isVisionModel.*gemini-2\.0"
# Search for any hardcoded model names containing gemini-2.0
rg "gemini-2\.0"
Length of output: 130 Script: #!/bin/bash
# Let's verify the complete context of isVisionModel function and its usage
# Get the complete isVisionModel function implementation
ast-grep --pattern 'function isVisionModel($_) { $$$ }'
# Find all usages of isVisionModel in the codebase
rg -A 3 "isVisionModel\("
# Check if there are any tests for isVisionModel
fd "test|spec" --exec rg "isVisionModel" {} \;
Length of output: 3210 Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
app/constant.ts
(1 hunks)
🔇 Additional comments (2)
app/constant.ts (2)
323-323
: Update Google API path handling for new models
Ensure that the Google.ChatPath
function in the constants properly handles the new models "gemini-1.5-flash-8b-latest" and "gemini-2.0-flash-exp".
Also applies to: 327-327
✅ Verification successful
Based on the results, I can see that the Google.ChatPath
implementation in app/constant.ts
uses a simple, model-agnostic path construction: v1beta/models/${modelName}:streamGenerateContent
. This implementation will work correctly with any model name, including the new models "gemini-1.5-flash-8b-latest" and "gemini-2.0-flash-exp", as it just interpolates the model name into a fixed path pattern.
The path handling for new Gemini models is already properly implemented
The current implementation in Google.ChatPath
uses a consistent pattern that works for all models by design, requiring no special handling for specific model names. The function simply interpolates any model name into the path v1beta/models/${modelName}:streamGenerateContent
.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check if the Google.ChatPath implementation handles these models
# Search for Google.ChatPath implementation and model handling
echo "Searching for Google API path handling..."
rg -A 10 "Google = \{"
# Search for any model-specific API path customizations
echo "Searching for model-specific paths..."
rg "ChatPath.*gemini-"
Length of output: 752
320-327
: Verify the model changes against Google's official documentation
Please ensure that these model changes align with Google's official documentation and announcements:
- The deprecation of "gemini-1.0-pro"
- The addition of new models "gemini-1.5-flash-8b-latest" and "gemini-2.0-flash-exp"
"gemini-1.0-pro", // Deprecated on 2/15/2025 | ||
"gemini-1.5-pro-latest", |
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.
🛠️ Refactor suggestion
Document the deprecation date in KnowledgeCutOffDate
The model "gemini-1.0-pro" is marked as deprecated, but its cutoff date should also be documented in the KnowledgeCutOffDate
constant for consistency.
Add the following entry to the KnowledgeCutOffDate
object:
export const KnowledgeCutOffDate: Record<string, string> = {
default: "2021-09",
+ "gemini-1.0-pro": "2025-02", // Based on deprecation date
// ... other entries
};
Committable suggestion skipped: line range outside the PR's diff.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
添加gemini-1.5-flash-8b-latest、gemini-2.0-flash-exp,移除已经舍弃的模型:gemini-pro-version
📝 补充信息 | Additional Information
Summary by CodeRabbit
"gemini-1.5-flash-8b-latest"
."gemini-1.0-pro"
(effective 2/15/2025)."gemini-pro-vision"
to"gemini-2.0-flash-exp"
."gemini-2.0"
to the classification.tauriStreamFetch
in Tauri environments.