tisfeng / Raycast-Easydict

A Raycast Extension for looking up words or translating text in an easy way. Support 48+ languages, support Linguee and Youdao dictionary, support OpenAI, DeepL, Google, Bing, Apple, Baidu, Tencent, Volcano, Youdao and Caiyun translation.
https://www.raycast.com/isfeng/easydict
MIT License
382 stars 21 forks source link

【功能建议】接入 OpenAI API #32

Closed six-ddc closed 1 year ago

six-ddc commented 1 year ago

请问有考虑通过接入 openai gpt API 来增强翻译能力吗?实测 gpt 的翻译是要比 DeepL 好用的。

github-actions[bot] commented 1 year ago

Hello six-ddc, Thank you for your first issue contribution 🎉

tisfeng commented 1 year ago

可以,有段时间没写 TS 了,有小伙伴来 PR 吗 🤓

six-ddc commented 1 year ago

可以,有段时间没写 TS 了,有小伙伴来 PR 吗 🤓

会一点 ts,我有空尝试一下 😁

tisfeng commented 1 year ago

可以,欢迎 PR 🤗

tisfeng commented 1 year ago

有小伙伴想写这个功能吗?没有的话我就抽空自己写一下了 😔

tisfeng commented 1 year ago

已提交 PR 支持了 OpenAI 翻译 https://github.com/raycast/extensions/pull/5424

six-ddc commented 1 year ago

@tisfeng 如果没有开启全局代理,好像会报错,不知道 raycast 支持给扩展配置代理吗?

x2: The operation was aborted.

c:index.js:70:17
AbortSignal.m:easydict.js:162:17318
[nodejs.internal.kHybridDispatch]:event_target:731:20
AbortSignal.dispatchEvent:event_target:673:26
tisfeng commented 1 year ago

请问具体是如何报错的?是进去就报错,还是超时崩溃,可以录个视频我看一下吗

tisfeng commented 1 year ago

OpenAI 请求时,默认会读取系统代理,如果没有代理,或者代理 IP 不符合 OpenAI 的判定,可能会报错 😢

tisfeng commented 1 year ago

修复优化了一下,你用仓库最新的代码跑一下看看 😤

tisfeng commented 1 year ago

商店 PR 也已经合并了 https://github.com/raycast/extensions/pull/5615 ,请测试一下。

six-ddc commented 1 year ago

好了,现在不会崩溃啦