Needs review
Project:
Mistral Provider
Version:
1.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Feb 2026 at 13:57 UTC
Updated:
26 Mar 2026 at 21:24 UTC
Jump to comment: Most recent
With #3566649: Add test coverage we have solid test-coverage with mocked inference API from mistral. It would be great to some foundational contract/integration tests ensuring everything works well with the real inference API as well.
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
Comment #2
fagoComment #5
nickolajAdds contract tests for chat, embeddings, and moderation operations using the real Mistral inference API. Tests are grouped under `ai_provider_mistral_contract`, excluded from regular CI runs, and configured to run via a weekly scheduled pipeline with the `MISTRAL_API_KEY` CI/CD variable.
Comment #6
mattlc commentedBecause of Drupal\ai\Base\AiProviderClientBase::loadApiKey() method we cannot set the key value directly into the setting, this have to refer to a Key entity.
With the modifications bellow, I was able to run the tests without the "Could not load the %s API key, please check your environment settings or your setup key" error.
In MistralContractTestBase, these modifications make the tests pass using the MISTRAL_API_KEY env variable :
There are 2 remaining failing tests:
It seams that the streaming chat is broken (empty chunks returned).