Fevol / obsidian-translate

Translate text and entire notes in Obsidian
MIT License
102 stars 6 forks source link

OpenAI Translator #52

Open Fevol opened 1 year ago

Fevol commented 1 year ago

With beta release 1.4.5 (accessible using BRAT), the OpenAI service has been added to the plugin, by recommendation of @ckt1031 and inspired by the OpenAI Translator Application.

I will be releasing this update by the end of the week. However, I am eagerly looking for any feedback for this service.

Specifically:


Some implementation details:

ckt1031 commented 1 year ago

Failed to use private GPT endpoints, and also NOT every custom API endpoints have v1/engines available.

image

Fevol commented 1 year ago

Can you give me an idea of what your API looks like? I can substitute the v1/engines endpoint to something else, but I need something that would work on most services (or otherwise, allow the user to specify what their API looks like and what it returns, but that seems a bit cumbersome).

Also, it seems like you're getting another error, if it doesn't show any sensitive information, can you share a picture of what error is being given in the devtools?

ckt1031 commented 1 year ago

There are no error messages in the background.

I have also reviewed your code regarding OpenAI services, The custom URL/domain will be treated as normal translation endpoint instead of OpenAI endpoint

You can figure this out safely, only $0.1 credit is available.

P.S., this plugin should allow us to config the model for custom endpoints, such as GPT-3.5, GPT-3.5-16K, and GPT-4.

Endpoint: https://one-api.ckt1031.xyz, https://one-api.ckt1031.xyz/v1, https://one-api.ckt1031.xyz/v1/chat/completions API Key: sk-cSakOOAB5cVI0uLw2c5eAe4e71814dF298Cb47EbB3B1FcEc

image