Problem/Motivation
There's two issues.
1 There is a new /ai module that will provide LLM's so that you in your code can use AI regardless of which AI is chosen in the settings.
(and this module is bound to OPENAI)
2 I only need the feature of translations of this module I prefer not to have the rest.
Proposed resolution
I ported the translation link and functionality to the AI module as a submodule: Check this issue here: https://www.drupal.org/project/ai/issues/3457200#comment-15674380
Remaining tasks
You could strip that functionality from your code here and be dependant on the ai module (ai_translate).
User interface changes
The user interface would change to "Translate using AI" (because in the back it could use Openai, or Mistral or ...)
Code changes
Make sure to check the code in the issue
https://www.drupal.org/project/ai/issues/3457200#comment-15674380
the call to openai is stripped and abstracted to a "AI" call using the provided AI service.
Comments
Comment #2
wouters_f commentedComment #3
wouters_f commentedYou might find the new version in the AI module interesting.
The prompts are more advanced and the code has been reviewed.
https://git.drupalcode.org/project/ai/-/merge_requests/10