-
Notifications
You must be signed in to change notification settings - Fork 59.3k
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
fix o1系列模型超时时间改为4分钟, #5658
fix o1系列模型超时时间改为4分钟, #5658
Conversation
@ccq18 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 modifies the Changes
Possibly related PRs
Suggested reviewers
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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
这里不建议直接改全局的超时时间。建议针对o1模型做更改 |
It is not recommended to directly change the global timeout here. It is recommended to make changes to the o1 model |
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.
app/constant.ts
Outdated
@@ -95,7 +95,7 @@ export const UNFINISHED_INPUT = (id: string) => "unfinished-input-" + id; | |||
|
|||
export const STORAGE_KEY = "chatgpt-next-web"; | |||
|
|||
export const REQUEST_TIMEOUT_MS = 60000; | |||
export const REQUEST_TIMEOUT_MS = 180000; |
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
Action Required: Review Global Impact of Timeout Change
The REQUEST_TIMEOUT_MS
constant is used across multiple modules in the codebase. Changing it globally to 180000ms will affect all components that rely on this timeout value.
Recommendations:
- Assess Scope: Determine if the increased timeout should apply universally or only to specific models (e.g., o1 series).
- Refactor if Necessary:
- If the timeout increase is intended only for certain models, consider creating model-specific timeout constants.
- Example:
export const DEFAULT_REQUEST_TIMEOUT_MS = 60000; export const O1_REQUEST_TIMEOUT_MS = 180000;
- Update Usages: Ensure that each usage of the timeout constant references the appropriate value based on the context.
Implementing these changes will help prevent unintended side effects and maintain optimal performance across different parts of the application.
🔗 Analysis chain
Approved: Timeout increased to 3 minutes as per PR objective.
The change from 60000ms to 180000ms (3 minutes) aligns with the PR objective to address timeout issues for o1 series models. This modification should help reduce the occurrence of response timeouts.
However, consider the following suggestions:
- Verify if this timeout should apply universally or if it should be model-specific.
- Add a comment explaining the rationale behind the 3-minute timeout, e.g.:
// Increased to 3 minutes to accommodate longer response times of o1 series models export const REQUEST_TIMEOUT_MS = 180000;
To ensure this change doesn't affect other parts of the codebase unintentionally, please run the following command:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for other usages of REQUEST_TIMEOUT_MS
rg "REQUEST_TIMEOUT_MS" --type typescript
Length of output: 76
Script:
#!/bin/bash
# Search for other usages of REQUEST_TIMEOUT_MS in TypeScript files
rg "REQUEST_TIMEOUT_MS" -g "*.ts" -g "*.tsx"
Length of output: 1469
Your build has completed! |
已修改,将o1系列目前默认的2分钟改为4分钟 |
Modified, changing the current default 2 minutes of the o1 series to 4 minutes |
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
🧹 Outside diff range and nitpick comments (1)
app/client/platforms/openai.ts (1)
355-355
: Update comment to reflect increased timeout for O1 modelsThe inline comment mentions that DALL-E 3 is slow, but the timeout is also increased for O1 models. Consider updating the comment to reflect that both DALL-E 3 and O1 models may have longer response times.
Apply this diff to update the comment:
- isDalle3 || isO1 ? REQUEST_TIMEOUT_MS * 4 : REQUEST_TIMEOUT_MS, // dalle3 using b64_json is slow. + isDalle3 || isO1 ? REQUEST_TIMEOUT_MS * 4 : REQUEST_TIMEOUT_MS, // DALL-E 3 and O1 models may have longer response times.
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
由于o1系列模型响应时间经常超过1分钟,因此修改默认超时时间为3分钟,减少响应超时的情况
📝 补充信息 | Additional Information
Summary by CodeRabbit