Problem/Motivation

In MistralConfigForm::submitForm(), the defaultIfNone() method is called with 'anthropic' as the provider ID instead of 'mistral':

$this->aiProviderManager->defaultIfNone('chat', 'anthropic', 'mistral-large-latest');                                                                                               
  $this->aiProviderManager->defaultIfNone('embeddings', 'anthropic', 'mistral-embed');  

when a user saves the Mistral configuration form and no default provider is set, the system attempts to set Anthropic as the default provider with Mistral model names, which is incorrect.

Steps to reproduce

1. Install Mistral provider module on a fresh site with no default AI providers configured
2. Navigate to /admin/config/ai/providers/mistral
3. Enter an API key and save the form
4. Check the AI settings - the default provider will not be set to Mistral as expected

Proposed resolution

Change the provider ID from 'anthropic' to 'mistral'

Remaining tasks

Fix the provider ID in MistralConfigForm.php

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

petar_basic created an issue. See original summary.

petar_basic’s picture

Assigned: petar_basic » Unassigned
Status: Needs work » Needs review

Fixed error in MistralConfigForm::submitForm() - changed provider ID from 'anthropic' to 'mistral' in both defaultIfNone() calls

fago made their first commit to this issue’s fork.

  • fago committed 630981ae on 1.1.x authored by petar_basic
    fix: #3570585: Default to correct provider in config form
    
    By:...
fago’s picture

Status: Needs review » Fixed

thx, straight-forward fix - merged!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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