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

Disable prefetching OpenAI #218

Open
psmits1567 opened this issue Apr 8, 2024 · 0 comments
Open

Disable prefetching OpenAI #218

psmits1567 opened this issue Apr 8, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@psmits1567
Copy link

Investigation revealed that GlotPress is prefetching translations to speed up UX
But that is unwanted behavior as the following is happening

  1. Open a page that does not contain translations, the first record is prefetched if you have a licence added for OpenAI
  2. When you open a record, GlotPress fetches both the current and the next record in the table.

Both lead to using extra credits from your OpenAI account, which in the end if you have a paid contract will cost extra money
It is up to the translator to make use of the extra function to prefetch translations
Currently OpenAI is quick enough to only fetch the suggestion when opening the editor

It also creates a problem when you are testing your prompt, because depending on the situation you get a cached result as the record is already fetched.
How to test:
Activate OpenAI
Add a working prompt
Open the first record
Check the translation
Close the editor
Change your prompt
Do not refresh your screen
Open the editor again for the same record
You will get the translation but you change in the prompt is not working as a cached record is provided

Proposal:
Make this an option and leave it up to the translator to make use of prefetching
Add a checkbox to do this

@psmits1567 psmits1567 added the enhancement New feature or request label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant