Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAI Translator #52

Open
Fevol opened this issue Jul 11, 2023 · 3 comments
Open

OpenAI Translator #52

Fevol opened this issue Jul 11, 2023 · 3 comments
Assignees
Labels
feedback required This issue needs community input is/shipped Has been shipped in the most recent update translation service Implementation of new translation service

Comments

@Fevol
Copy link
Owner

Fevol commented Jul 11, 2023

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:

  • How will you be using the service? Does it work decently?
  • Why do you prefer to translate with OpenAI over the other services (thus, should I be focusing more on GPT's capabilities?)

Some implementation details:

  • The service works by simply passing along following prompts for a given input:
    • Detect language: Identify the language of the input, please ONLY output its ISO639-1 code:\n INPUT
    • Translate (auto detect language): Translate following text to 'TARGET' without explanation, include ISO639-1 locale of the input in the first line:\n INPUT
    • Translate (source language given): Translate following text from 'SOURCE' to 'TARGET' without explanation:\n INPUT
  • Currently, I haven't considered the token limit at all. I made the assumption that people wouldn't translate entire notes using this service (current limit for GPT3.5 is at ~10.000 characters or ~1.000 words, or double that with GPT4)
  • The plugin tries to focus on only one thing, being translating text. I realise that GPT can be used in many more tasks (such as pronunciation, sentence dissection, word-by-word explanations, however, I personally feel that this is outside of the scope of the plugin, and would be tricky to implement)
  • If you use any proxy GPT services, please do let me know. Currently, only the official API is implemented and tested.
@Fevol Fevol added translation service Implementation of new translation service is/ready to ship Will be shipped in the next update labels Jul 11, 2023
@Fevol Fevol self-assigned this Jul 11, 2023
@Fevol Fevol added feedback required This issue needs community input and removed is/ready to ship Will be shipped in the next update labels Aug 4, 2023
@ckt1031
Copy link

ckt1031 commented Aug 4, 2023

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

image

@Fevol
Copy link
Owner Author

Fevol commented Aug 4, 2023

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?

@Fevol Fevol added the is/shipped Has been shipped in the most recent update label Aug 5, 2023
@ckt1031
Copy link

ckt1031 commented Aug 7, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback required This issue needs community input is/shipped Has been shipped in the most recent update translation service Implementation of new translation service
Projects
None yet
Development

No branches or pull requests

2 participants