tisfeng / Easydict

一个简洁优雅的词典翻译 macOS App。开箱即用,支持离线 OCR 识别,支持有道词典,🍎 苹果系统词典,🍎 苹果系统翻译,OpenAI,Gemini,DeepL,Google,Bing,腾讯,百度,阿里,小牛,彩云和火山翻译。A concise and elegant Dictionary and Translator macOS App for looking up words and translating text.
GNU General Public License v3.0
6.38k stars 324 forks source link

perf: update library tisfeng/OpenAI, enable to cancel OpenAI stream query #577

Closed tisfeng closed 4 weeks ago

tisfeng commented 1 month ago

Close https://github.com/tisfeng/Easydict/issues/560

Now we can cancel OpenAI stream request when clicking stop button.

feat: implement cancellable in https://github.com/tisfeng/OpenAI/pull/1

tisfeng commented 4 weeks ago

Please review this PR.

Jerry23011 commented 4 weeks ago

I'm testing with Built-in AI tranlsation, and from my web debugging proxy, the streaming didn't stop after I pressed stop?

Jerry23011 commented 4 weeks ago

https://github.com/tisfeng/Easydict/assets/89069957/de167ff0-24a9-4965-8d0a-165409cb29e7

tisfeng commented 4 weeks ago

ok, I will check it later.

tisfeng commented 4 weeks ago

During the previous git merge, the crucial control.cancel() was mistakenly deleted, resulting in the request not being truly canceled.