-
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
add gemini-exp-1206, gemini-2.0-flash-thinking-exp-1219 #5958
Conversation
@dupl is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request updates the Changes
Possibly related PRs
Poem
Tip CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command 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
π§Ή Nitpick comments (1)
app/constant.ts (1)
Line range hint
277-282
: Improve comment professionalism and consider a more maintainable approach
- The comment's tone ("stupid hardcoding") should be more professional.
- Consider implementing a more maintainable solution for managing knowledge cutoff dates.
Consider these improvements:
- Replace the comment with a more professional version:
- // After improvements, - // it's now easier to add "KnowledgeCutOffDate" instead of stupid hardcoding it, as was done previously. + // Knowledge cutoff dates are maintained here for all supported models. + // TODO: Consider implementing a dynamic configuration system for easier updates.
- Consider implementing a more maintainable solution:
interface ModelMetadata { cutoffDate: string; deprecated?: boolean; experimentalUntil?: string; } const MODEL_METADATA: Record<string, ModelMetadata> = { "gemini-pro": { cutoffDate: "2023-12", experimentalUntil: "2024-12-31" }, // ... other models };
π Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
π Files selected for processing (1)
app/constant.ts
(1 hunks)
π Additional comments (1)
app/constant.ts (1)
328-336
: Verify experimental model availability
Several experimental models have been added (e.g., gemini-2.0-flash-thinking-exp-1219
, gemini-exp-1206
). These models might have limited availability or specific access requirements.
Let's verify the model availability in the documentation:
β Verification successful
Experimental models are properly configured in the codebase
The experimental Gemini models are properly defined in the codebase:
- They are listed in the
googleModels
array inapp/constant.ts
- The experimental models are also recognized in vision capabilities through
gemini-exp
keyword inapp/utils.ts
- The models follow a consistent naming pattern with other Gemini models
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Search for documentation about experimental models
# Expected: Find references to these models in documentation or configuration files
# Search for model references in documentation
fd -e md -e mdx | xargs rg -l "gemini.*exp"
# Search for model configuration
rg "gemini.*exp" -A 5 -B 5
Length of output: 1332
"gemini-1.5-flash", | ||
"gemini-1.5-flash-002", | ||
"gemini-1.5-flash-8b", | ||
"gemini-1.5-flash-exp-0827", | ||
"gemini-1.5-pro", | ||
"gemini-1.5-pro-002", | ||
"gemini-1.5-pro-exp-0827", | ||
"gemini-2.0-flash-thinking-exp-1219", | ||
"gemini-exp-1206", |
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.
Add knowledge cutoff dates for new Gemini models
The new Gemini models have been added, but their knowledge cutoff dates are not defined in the KnowledgeCutOffDate
object. This could lead to incorrect cutoff date information being displayed to users.
Add the following entries to the KnowledgeCutOffDate
object:
export const KnowledgeCutOffDate: Record<string, string> = {
// ... existing entries ...
+ "gemini-1.5-flash": "2024-04",
+ "gemini-1.5-flash-002": "2024-04",
+ "gemini-1.5-flash-8b": "2024-04",
+ "gemini-1.5-flash-exp-0827": "2024-04",
+ "gemini-1.5-pro": "2024-04",
+ "gemini-1.5-pro-002": "2024-04",
+ "gemini-1.5-pro-exp-0827": "2024-04",
+ "gemini-2.0-flash-thinking-exp-1219": "2024-04",
+ "gemini-exp-1206": "2024-04",
};
Committable suggestion skipped: line range outside the PR's diff.
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 (2)
app/client/platforms/openai.ts
(1 hunks)app/utils.ts
(1 hunks)
π Additional comments (1)
app/client/platforms/openai.ts (1)
243-243
: Verify GLM-4V Flash token limit requirements.
The exclusion of "glm-4v-flash" from the max tokens setting suggests different token limit requirements for this model. Please ensure this is the intended behavior.
Let's verify the token limit handling for GLM-4V Flash:
β Verification successful
GLM-4V Flash model's token limit handling is intentionally different
Based on the code analysis, the exclusion of "glm-4v-flash" from the max_tokens setting is intentional. The codebase shows that max_tokens (minimum 4000) is only applied to vision models except for GLM-4V Flash. This is consistent with other model implementations in the codebase where token limits are handled differently for specific models (e.g., O1 models use max_completion_tokens instead of max_tokens).
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for GLM-4V Flash model configuration and documentation
rg -A 10 "glm-4v-flash" --type ts --type tsx
# Search for any token limit configurations
ast-grep --pattern 'max_tokens = $_'
Length of output: 111
Script:
#!/bin/bash
# Search for GLM-4V Flash model configuration with correct file type
rg -A 10 "glm-4v-flash" --type typescript
# Search for token limit configurations with a more flexible pattern
rg -B 5 -A 5 "maxTokens|max_tokens|tokenLimit" --type typescript
# Look for model configuration files
fd -e ts -e js "model|config" --type f --exec rg -l "glm-4v"
Length of output: 239
Script:
#!/bin/bash
# Search for GLM-4V Flash model configuration without file type restriction
rg -A 10 "glm-4v-flash"
# Search for token limit configurations
rg -B 5 -A 5 "maxTokens|max_tokens|tokenLimit"
# Find all TypeScript files and search for GLM-4V related configurations
fd -e ts . | xargs rg "glm-4v"
Length of output: 38384
@@ -265,6 +265,7 @@ export function isVisionModel(model: string) { | |||
"learnlm", | |||
"qwen-vl", | |||
"qwen2-vl", | |||
"glm-4v", |
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.
π‘ Codebase verification
GLM-4V model is not properly integrated in the codebase
The codebase shows inconsistencies in GLM-4V support:
- "glm-4v" is listed in vision keywords but not in the
chatglmModels
array - There's a reference to "glm-4v-flash" in OpenAI platform handling, but it's not properly defined
- The vision model detection doesn't properly account for GLM-4V variants
π Analysis chain
LGTM! Verify GLM-4V vision capabilities.
The addition of "glm-4v" to the vision keywords list is consistent with the model's capabilities.
Let's verify the GLM-4V model's vision capabilities and its usage in the codebase:
π Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for GLM-4V model usage and configuration
rg -A 5 "glm-4v" --type ts --type tsx
Length of output: 65
Script:
#!/bin/bash
# Search for GLM-4V model usage and configuration with correct file type
rg -A 5 "glm-4v"
# Also check for any configuration or constant files
fd -e ts -e js "config|const" --exec rg -l "glm"
# Check for vision-related functionality
rg -i "vision.*model|image.*model"
Length of output: 2209
Script:
#!/bin/bash
# Check the vision keywords and GLM model configuration
cat app/constant.ts
# Check the vision model implementation
cat app/utils.ts | grep -A 10 "isVisionModel"
# Check GLM-4V specific handling
cat app/client/platforms/openai.ts | grep -A 10 "glm-4v"
Length of output: 15225
π» εζ΄η±»ε | Change Type
π εζ΄θ―΄ζ | Description of Change
π θ‘₯ε δΏ‘ζ― | Additional Information
Summary by CodeRabbit
New Features
googleModels
array.KnowledgeCutOffDate
with specific cutoff dates for various models to reflect their availability.Bug Fixes