yihong0618 / duolingo_remember

Automatically send new words from duolingo to telegram
MIT License
167 stars 44 forks source link

Support EdgeGPT #5

Closed longfangsong closed 1 year ago

longfangsong commented 1 year ago

For a poor guy who has no OpenAI API access like me, EdgeGPT is an acceptable substitution.

With this PR, if you set EDGE_GPT_COOKIE instead of OPENAI_API_KEY, we'll use new bing instead of chatgpt for story generation and translating.

longfangsong commented 1 year ago

And it do works:

截屏2023-04-24 15 36 07 截屏2023-04-24 15 36 12
yihong0618 commented 1 year ago

Thanks a lot.

yihong0618 commented 1 year ago

@longfangsong I just support conversion~ https://twitter.com/yihong0618/status/1650498003294359552?s=20 can you help to add EdgeGPT support ?

longfangsong commented 1 year ago

@longfangsong I just support conversion~ https://twitter.com/yihong0618/status/1650498003294359552?s=20 can you help to add EdgeGPT support ?

Working on it! And since there are probably more AI backends (Bard, Azure powered OpenAI, or even a local llama someday), we may do some refactor on managing these promotes.

PS. Have you considered to do a real "chat" mode for this?

I've made a edge powered chat bot here. And I use this promote:

I am learning Swedish. Please act as a Swedish teacher and talk with me in Swedish. And correct me if I made any mistakes.

Please do it in this form, and don’t say anything else:

You mean "<rewrite what I say in correct Swedish words and grammar>”.

Mistakes you made:
- If I failed to spell a word correctly, then just say: The correct spell for <English meaning> is <Swedish word>.
- If I made a mistake about part of speech inflections, just tell me: <wrong word form> should be <correct word form> in <part of speech>.
- If I use a word that is not suitable in this context, just tell me: <wrong word> should be <correct word> in this context.
- Else just explain in a way you like.

<Your response>

(<Your response’s English translation>)

To try some "real" talk in Swedish with the bot.

图片 图片

I store the chatting context in Upstash and created a telegram callback on vercel, both are 100% free.

Hope these inspiring!

yihong0618 commented 1 year ago

cool

longfangsong commented 1 year ago

Update: blocked by EdgeGPT#343