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.4k stars 325 forks source link

perf: enable built-in AI to set usage status and dict option #525

Closed tisfeng closed 2 months ago

tisfeng commented 2 months ago
image
tisfeng commented 2 months ago

I just refactored some code related to OpenAI, mainly allowing dynamic keys to be created based on the type of service, and then storing the configuration items for the service. This has reduced a lot of duplicated code.

@phlpsong There is still room for further optimization in the code here, like Defaults.Keys in the Configuration+Defaults file, these can be handled in later issues, such as #479 and #497.

tisfeng commented 2 months ago

I'm going to merge this PR, are there any questions?

phlpsong commented 2 months ago

Nice work👍

I have been busy recently, I will schedule some time to take a look at these optimization issues later.

tisfeng commented 2 months ago

ok