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
7.46k stars 376 forks source link

🚀 Feature Request: Add support for pplx api #254

Closed hiuxia closed 12 months ago

hiuxia commented 12 months ago

Please confirm the following:

Feature description

Add support for perplexity ai for translation support, like openai api.

  • The price is cheaper
  • Has online module on its in-house 7b and 70b module.

Use case (optional)

Here are a few preliminary, very unmature ideas:

Proposed solution (optional)

I can provide the an api key($5) and help testing the prompt. Besides I think pplx playground is the best place to try this Api.

Are you willing to submit a PR to implement this feature

github-actions[bot] commented 12 months ago

Hello hiuxia, Thank you for your first issue contribution 🎉

tisfeng commented 12 months ago

Why did you close it?

I haven't had a chance to learn about perplexity ai , which looks like it's also an OpenAI-like service, what's wrong with it?

hiuxia commented 12 months ago

Sorry for this my stupid misunderstanding. I just thought that this request maybe require too much work for you(捂脸). So I closed it in order not to bother.

hiuxia commented 12 months ago

Perplexity is a wonderful third party LLM service that integrates GPT4, claude 2.1 and other functions like image search, generation, video search; It also supports personal prompt for each of your thread by assigning them to collections.

Besides, it provides up to 600 GPT4 and claude 2.1 usage with rapid Internet search(offline is also supported). It also provides 5 dollars quota api for its pro users(which is 20$ like chatgpt), but It always have some coupons like two months free for new subscribers.

This is not an ad.

hiuxia commented 12 months ago

The reason why I would like to open this issue is that I think this wonderful macos application can definitely serve as an language learning hub (especially for English). With such a beautful UI and excellent design, I think this app can be used to bridge the gap between different different scenarios (maybe by establishing a plugin system?):

Very unmature idea: Maybe this app can not only be used as language dictionary, but also for other aims, like language learning and code explanation.

hiuxia commented 12 months ago

Because of my own capacity constraints, I can't make a PR by myself. But I will try my best to help you If you have relevant ideas.

tisfeng commented 12 months ago

Thanks for the introduction, indeed, integrating a 3rd party service is quite a bit of work, especially an LLM service.

Currently Easydict only supports the OpenAI API, so if Perplexity provides an API that is compatible with OpenAI, you can use it directly in Easydict for now. If not, I suggest to find a third-party API conversion service to convert Perplexity's API to something like OpenAI API, e.g. one-api, so that other applications can use it more easily.

one-api is a very good OpenAI API management service, you can submit PR or issue to make one-ap support Perplexity.

tisfeng commented 12 months ago

Currently, our team's development manpower is insufficient and maintaining a new LLM service is too burdensome, I prefer to use one-ap as a conversion method to access the new LLM.

Of course, if there are partners who are willing to submit PRs, they are certainly welcome.

hiuxia commented 12 months ago

I have checked one api already and there are already an issue about pplx api integration. Any way, thank you for the support.

tisfeng commented 12 months ago

Maybe this app can not only be used as language dictionary, but also for other aims, like language learning and code explanation.

Good idea, I've been thinking about it. The problem is that we don't have enough developers in our team, and more importantly, I'm not good at doing some complex feature design and the corresponding UI design.

On the other hand, I have a high demand for new features, and I want the app to be simple and elegant while still being powerful.

hiuxia commented 12 months ago

So I think a useful plugin system can be pretty useful. At least I think maybe we can extract the APIs to module like other similar app like Bob, and by such way people can surely implement the features more easily and you can save a lot of laborious job.

hiuxia commented 12 months ago

Recently I wrote quiet a few popclip addons and I found they emancipated me from all kinds of tedious jobs. Basically, I think any text processing app would double their productivity with a well designed addon system, the most famous example should be vscode.

tisfeng commented 12 months ago

At first I thought Easydict was an open source application that everyone could come to PR, so there was no need to have an open plugin system like Bob must have.

But later I realized that the number of developers who can write objc or Swift is too small compared to the number of developers who can write JS, so if I can make a JS plugin system, it can greatly enrich the ecosystem of Easydict.

However, my JS level is very low, I'm afraid I can't design a powerful plugin system similar to PopClip, so I've put it on hold 😔