Make selection of AI Provider clearer on module homepage

Created on 13 January 2025, 3 months ago

Problem/Motivation

There's a link to module homepage from /en/admin/config/ai/settings with an instruction to "Choose a provider" but it's not clear when visiting the page what you're choosing from. There's a list of providers, but it's not clear these are a list of modules from which you need to choose one to download and enable. They could just as easily be links to those providers' homepages.

Steps to reproduce

  1. Visit /en/admin/config/ai/settings
  2. Read instructions
  3. Visit homepage
  4. Scroll up and down wondering what you need to do ;)

Proposed resolution

Can I suggest you add a sentence after the "AI Providers" title on https://www.drupal.org/project/ai to explain these are the provider modules you need to use to enable functionality? At the moment they look and are referred to as a list of providers, not the modules you need to enable said providers.

Something like:

The AI module currently supports these AI Providers. You need to download and enable one of these modules to use with the main AI module.

📌 Task
Status

Active

Version

1.0

Component

Documentation

Created by

🇬🇧United Kingdom dunx

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

Merge Requests

Comments & Activities

  • Issue created by @dunx
  • 🇧🇪Belgium wouters_f Leuven

    Great suggestion.:
    I'll do a proposal, let me know what you think.

    AI Providers

    In order to power your Dupal with AI, you'll need a AI provider module. Here are some of the frequently used provider modules:

    • Anthropic
    • ...
    • Openai

    I also propose to show an error or warning in the ai core module on installation if no providers are enabled or installed.

  • 🇧🇪Belgium wouters_f Leuven

    What do you think if We show a warning on /admin/config/ai/settings ?
    Something like this?

  • Merge request !407[3499412] show no providers warning → (Merged) created by wouters_f
  • 🇧🇪Belgium wouters_f Leuven

    I've committed this text:
    You have no AI providers enabled. Please install and enable a provider module.
    I'm proposing a merge request like this.

  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    Change looks straightforward enough! But should use $this->t() I think

  • 🇬🇧United Kingdom dunx

    Text at #2 is perfect.

    I think the other issue was discussed at https://www.drupal.org/project/ai/issues/3498757#comment-15939611 🐛 Installation/configuration resilience (ai_translate) Active , which you pointed to an existing ticket at https://www.drupal.org/project/ai/issues/3498887#comment-15944828 Add useful message on providers page when no provider enabled Active

    I'll try to test that patch and the above patch today.

  • 🇬🇧United Kingdom dunx

    Steps to reproduce...

    1. Install latest D11 Umami plus drush
    2. Download admin_toolbar and key modules.
    3. ddev composer require 'drupal/ai:^1.0.x-dev'
    4. ddev drush en ai ai_translate key admin_toolbar admin_toolbar_tools -y
    5. Create an Article in English.
    6. Click translate tab.

    I see an error message:

    I click on the link in the error to /en/admin/config/ai/providers and the text there tells me to "Choose a provider from the AI module homepage, add it to your project, then install and configure it first."

    I ignore the first instruction to "Choose a provider" and click on the link to "configure it first" instead, which goes to /en/admin/config/ai/providers

    I see an Access Denied error.

    Issue reproduced.

    Let's install this fix...
    ddev composer config repositories.ai vcs https://git.drupalcode.org/issue/ai-3499412.git
    ddev composer require drupal/ai:3499412-no-provider-warning-dev

    Back at /en/admin/config/ai/settings I now see a new Warning message: "You have no AI providers enabled. Please install and enable a provider module."

    This is an improvement as it makes it clear you have an immediate issue you need to deal with.

    I think clarity would be further enhanced by changing the second sentence shown on screen from:

    Choose a provider from the AI module homepage, add it to your project, then install and configure it first.

    to

    Choose at least one AI provider module from those listed on the AI module homepage, add to your project, install and configure it. Then update the AI Settings on this page.

  • 🇧🇪Belgium wouters_f Leuven

    Changes the text on the AI module page and added in your copy here.
    This should be sufficient like this.

  • First commit to issue fork.
  • 🇩🇪Germany marcus_johansson

    Fixed the comment from BramDriesen and I am merging this - thanks all.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024