Skip to content
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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

BlackStar1453
Copy link
Contributor

ChatGPT Web now utilizes WebSocket for data transmission.

@yetone
Copy link
Collaborator

yetone commented May 3, 2024

‌‌Thank you for your contribution, it seems there are some code conflicts that need to be resolved.

@BlackStar1453
Copy link
Contributor Author

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) {
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

@Loongphy
Copy link

Any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants