-
Notifications
You must be signed in to change notification settings - Fork 60.2k
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
解决禁止gpt4时禁止gpt4o-mini的bug #5209
Conversation
@mayfwl is attempting to deploy a commit to the NextChat Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe recent changes enhance the filtering logic for model retrieval in two key functions: Changes
Poem
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Your build has completed! |
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- app/api/openai.ts (1 hunks)
- app/config/server.ts (1 hunks)
Additional comments not posted (2)
app/api/openai.ts (1)
16-17
: LGTM! Verify the function usage in the codebase.The code changes are approved. The logic correctly includes models starting with "gpt-40-mini" while excluding other "gpt-4" models when
disableGPT4
is true.However, ensure that the function usage is consistent with the new logic.
Verification successful
Let's rerun the search for
getModels
usage without specifying the file type to ensure we capture all instances in the codebase.
Function usage verified and consistent.
The
getModels
function is used within the same fileapp/api/openai.ts
, and the usage is consistent with the new logic that includes models starting with "gpt-40-mini" while excluding other "gpt-4" models whendisableGPT4
is true.
app/api/openai.ts
: Verified usage ofgetModels
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `getModels` in the codebase. # Test: Search for the function usage. Expect: Consistent usage with the new logic. rg --type javascript -A 5 $'getModels'Length of output: 72
Script:
#!/bin/bash # Description: Verify the usage of `getModels` in the codebase. # Test: Search for the function usage. Expect: Consistent usage with the new logic. rg -A 5 'getModels'Length of output: 647
app/config/server.ts (1)
117-126
: LGTM! Verify the function usage in the codebase.The code changes are approved. The logic correctly excludes models starting with "gpt-4o-mini" while handling other "gpt-4" models when
disableGPT4
is true.However, ensure that the function usage is consistent with the new logic.
@@ -13,7 +13,7 @@ function getModels(remoteModelRes: OpenAIListModelResponse) { | |||
|
|||
if (config.disableGPT4) { | |||
remoteModelRes.data = remoteModelRes.data.filter( | |||
(m) => !m.id.startsWith("gpt-4"), | |||
(m) => !m.id.startsWith("gpt-4") || m.id.startsWith("gpt-40-mini"), |
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.
gpt-40-mini => gpt-4o-mini
💻 变更类型 | Change Type
#5145
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information
解决禁止gpt4时禁止gpt4o-mini的bug
Summary by CodeRabbit
New Features
Bug Fixes