Support chat operation type AI providers

Created on 15 January 2025, 4 days ago

Problem/Motivation

In an early version of this module when this was a standalone one, there was a modular way to support different AI providers. The problem was just that it was completely custom. Later on, the module started using the API and features provided by the Drupal AI framework , as it was simultaneously enhanced with the translate_text operation type, and an AI provider module supporting the DeepL translation API. But that change dropped support for ChatGPT.

Now that the generalization layer for the AI stuff is in place, we could easily support any AI provider that supports the chat operation, ChatGPT being only one of them.

Proposed resolution

* Refactor the code to be able to work with both translate_text and chat operation providers, making the module more independent of specific AI services.
* Enhance config form to allow configuring the provider/model for each language independently. It's been told that some providers do better with some languages than others.
* When enabling chat operation type as a translation backend, configuring the prompt has to be possible too, making it possible for an admin to alter the answer.

The AI Translate submodule may provide inspiration on how to actually implement those.

User interface changes

The settings form changes.

Data model changes

There will be new settings and some are deleted. An update hook providing a smooth update path is a nice-to-have, even though the module is at an alpha level.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇫🇮Finland jhuhta

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024