Problem/Motivation

The definitions/api_defaults.yml file only defines the chat operation, but the Mistral provider supports three operations: chat, embeddings, and moderation.

Steps to reproduce

1. Install the Mistral provider module
2. Try to view available configuration for embeddings or moderation operations via the AI Explorer
3. No configuration examples are shown

Proposed resolution

Add embeddings and moderation sections to api_defaults.yml, following the pattern used by other providers (OpenAI, Ollama).

Remaining tasks

- Add embeddings section to api_defaults.yml
- Add moderation section to api_defaults.yml

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

Added embeddings and moderation operation definitions to api_defaults.yml. The file previously only defined chat, but the provider supports all three operations.

Now getApiDefinition() returns complete API documentation for all supported operations:

drush php-eval "                                                                                                                                            
    \$provider = \Drupal::service('ai.provider')->createInstance('mistral');                                                                                                          
    \$def = \$provider->getApiDefinition();                                                                                                                                           
    print 'Operations defined: ' . implode(', ', array_keys(\$def)) . PHP_EOL;                                                                                                        
    foreach (['chat', 'embeddings', 'moderation'] as \$op) {                                                                                                                          
      \$desc = \$def[\$op]['input']['description'] ?? 'MISSING';                                                                                                                      
      print \"  \$op: \$desc\" . PHP_EOL;                                                                                                                                             
    }                                                                                                                                                                                 
  "  

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

  • fago committed a6a5f763 on 1.1.x authored by petar_basic
    fix: #3570588 Embeddings and moderation operations should be defined in...
fago’s picture

Status: Needs review » Fixed

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.