Create a form element for selecting providers

Created on 5 November 2025, 9 days ago

Problem/Motivation

Currently we have the form helper service that you can invoke and that we do invoke at places.

We also have a helper function in the plugin manager that can make a simple list for anyone that would prefer it.

However, every module implements this differently. And stores it differently.

We already have the issue for saving the provider configuration in a structured manner here: Create linkable schema for providers Active and we might create a follow up to also add a DTO or an object for it, so we have some abstraction around it.

What we need is a common form element.

We have currently one pattern where you choose provider first and model second, this is probably not that useful for anyone that isn't an AI module developer. Most sites has one provider, and some two. Very few has 5 or something like this. So the simple version that show {provider name - model name} is good.

Proposed resolution

  • Create a new form element called "ai_provider_configuration"
  • Add so it has a boolean config if the configuration fields should show up called "#advanced_config". Default to true. This would show the configuration settings for each provider.
  • Add so it has a boolean config if a default provider is allowed to be set called "#default_provider_allowed". If so a value called "Default Value" should show up. Default to true.
  • Add so it has a required string config of the operation type, including pseudo operation types you can set.
  • If advanced config is true, make sure to have a form helper similar to the service, that loads via ajax the config for that specific model.
  • Make sure that the value returned is an array with provider (string), model (string), config (array). Config is empty array on not advanced config existing.
  • Make sure that the default value can take this.
  • Make sure that the default value, automatically set the default provider/model for an operation type, if nothing else is set.
  • Write a browser test to make sure that the ajax loading exists.
  • Write documentation for how to use it.
Feature request
Status

Active

Version

2.0

Component

AI Core module

Created by

🇩🇪Germany marcus_johansson

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

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024