-
Notifications
You must be signed in to change notification settings - Fork 1.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
fix: chatgpt-web #1503
base: main
Are you sure you want to change the base?
fix: chatgpt-web #1503
Conversation
ChatGPT Web now utilizes WebSocket for data transmission.
Thank you for your contribution, it seems there are some code conflicts that need to be resolved. |
Thanks for the reminder. I've already resolved the conflicts, but I'm having trouble understanding the Lint errors that came up and don't know how to fix them. |
iI had to modify the eslint config and set /* eslint-disable prettier/prettier */ in the settings and translator components because otherwise, I would encounter prettier/prettier errors that I didn't understand. I hope you can review this portion of the code and make appropriate modifications.
@@ -193,7 +192,7 @@ export class QuoteProcessor { | |||
|
|||
const chineseLangCodes = ['zh-Hans', 'zh-Hant', 'lzh', 'yue', 'jdbhw', 'xdbhw'] | |||
|
|||
export async function translate(query: TranslateQuery) { | |||
export async function translate(query: TranslateQuery, engine: IEngine | undefined) { |
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.
Why is this engine singled out?
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.
Because maintaining a long-term connection is necessary when using WebSockets, we don't have to re-register the WebSocket every time a request is made. To ensure the WebSocket's long-term existence, we need a long-term existing engine, rather than generating a new engine every time the translate function is used, as was done previously.
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.
Can this engine
be used as a field in TranslateQuery
?
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.
It should be fine. I'll give it a try tomorrow when I have time . Also, OpenAI has updated their request specifications, so we need to make some minor adjustments too.
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.
I've noticed that setting the engine used as a field in TranslateQuery isn't feasible. This is because the engine needs to exist as a useState to avoid being rebuilt every time the translate method is called. Unless you plan to revert to the previous WebAPI Class approach, it's preferable to continue passing the engine as the second parameter, as we're currently doing.
Any progress? |
ChatGPT-Web is now available for use, but it seems that occasional usage issues may arise due to risk control, resulting in 403 errors. Multiple attempts may be necessary.
Maybe we could retry the request upon encountering a 403 error, and continue doing so until we receive at least 3 consecutive errors before displaying them on the interface? This could enhance the user experience. |
I've found that even when I use the ChatGPT website, I run into the same problem. So, it might not be a ChatGPT-Web issue but rather, OpenAI might be flagging our IP or device as risky, causing access denials. |
I've found that the issue was actually due to the proof token algorithm. After the update, it's been resolved. Additionally, it appears we can do away with WebSocket and stick with SSE alone, so there's no need to separately set the engine as a parameter. I'll get this update done when I have the time. |
ChatGPT Web now utilizes WebSocket for data transmission.