Skip to content

Disable prefetching OpenAI #218

Open
@psmits1567

Description

@psmits1567

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions