Avoid crashing the AI settings page if the default provider is not fully configured

Created on 26 September 2024, 3 months ago

Problem/Motivation

When an API-based provider like OpenAI is not fully configured and is missing its API key, it can lead to a crash when the user visits the /admin/config/ai/settings page.

We should have some graceful error handling in place, so that the site builder is aware of what to do.

Steps to reproduce

  1. Install the OpenAI provider and have it configured as your default provider.
  2. Remove the API key from the provider
  3. Visiting the AI settings page will result in a crash because it can't load the API key.

Proposed resolution

Add more error handling to avoid nullpointer exceptions as well as catch more setup exceptions where relevant.

We can either check if the default provider is configured and usable before trying to fetch models from it, or we try to fetch the models and show the setup exception error message to the user.

Remaining tasks

Provide issue fork.

User interface changes

TBD

🐛 Bug report
Status

Active

Version

1.0

Component

Providers

Created by

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