Skip to content

feat: native Mistral provider (OpenAI-compatible, EU-hosted)#5

Merged
roboshyim merged 1 commit into
mainfrom
feat/mistral-provider
Jul 21, 2026
Merged

feat: native Mistral provider (OpenAI-compatible, EU-hosted)#5
roboshyim merged 1 commit into
mainfrom
feat/mistral-provider

Conversation

@roboshyim

Copy link
Copy Markdown
Collaborator

What

Adds Mistral as a first-class, preconfigured provider — P0 roadmap item #5. Merchants paste an API key and go (no manual endpoint setup). Mistral's API is OpenAI-compatible, so chat is delegated to the existing OpenAiChatClient pointed at the Mistral endpoint.

Why

EU data-residency wedge for the German/EU merchant base — a strong differentiator vs. the paywalled Shopware Copilot. Cheap to add (reuses OpenAI-compatible plumbing), keeps the provider-agnostic positioning.

Changes

  • MistralProvider (src/Provider/Mistral/MistralProvider.php): ID mistral, config keys mistralApiKey / mistralBaseUrl / mistralDefaultModel, capabilities TextGeneration / Vision / ToolCalling / StructuredOutput / Reasoning / Temperature (no image generation).
  • MistralClient: wraps OpenAiChatClient for chat() against https://api.mistral.ai/v1; generateImage() throws ImageGenerationNotSupportedException (Mistral text models don't generate images).
  • services.xml registration (frosh_ai.provider tag).
  • config.xml card (en + de-DE).
  • Admin component frosh-ai-provider-mistral + module import + detail-page allowlist entry.
  • en-GB / de-DE snippets.
  • MistralProviderTest (7 tests): identity/descriptor, capabilities, isConfigured, getClient (success + not-configured exception), admin status.

Tests

96 tests / 376 assertions, green — verified both locally and in the frosh-ai-dev container (Shopware 6.7 / PHP 8.3).

Notes

  • Live inference ("Test connection") requires a Mistral API key; not exercised here.
  • Admin component registered like the other providers; requires an admin rebuild to appear (existing deployment step, not a code change).

- MistralProvider: config keys mistralApiKey/mistralBaseUrl/mistralDefaultModel,
  capabilities TextGeneration/Vision/ToolCalling/StructuredOutput/Reasoning/Temperature
  (no image generation)
- MistralClient: delegates chat to OpenAiChatClient against https://api.mistral.ai/v1,
  throws ImageGenerationNotSupportedException for generateImage
- services.xml registration, config.xml card (en + de-DE)
- admin component frosh-ai-provider-mistral + module import + detail-page allowlist
- en-GB/de-DE snippets, MistralProviderTest (7 tests)
@roboshyim
roboshyim merged commit ad7e00f into main Jul 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants