Python: Add Mistral AI embedding client package#5480
Open
daric93 wants to merge 13 commits intomicrosoft:mainfrom
Open
Python: Add Mistral AI embedding client package#5480daric93 wants to merge 13 commits intomicrosoft:mainfrom
daric93 wants to merge 13 commits intomicrosoft:mainfrom
Conversation
Author
|
@eavanvalkenburg please review when you have time — this implements the Mistral AI embedding client from #4171. |
fc9c4de to
39b15eb
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new Python package to integrate Mistral AI embeddings into the agent framework, including unit/integration tests and CI wiring.
Changes:
- Introduces
agent-framework-mistralpackage with raw + telemetry-wrapped embedding clients - Adds tests (unit + optional integration) and registers them in integration workflows
- Updates workspace config for dependency overrides and package/test discovery
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| python/pyproject.toml | Adds workspace package registration, pyright test roots, and an OpenTelemetry dependency override |
| python/packages/mistral/agent_framework_mistral/_embedding_client.py | Implements raw + telemetry embedding clients and Mistral-specific option/settings types |
| python/packages/mistral/tests/mistral/test_mistral_embedding_client.py | Adds unit tests and a skipped-by-default integration test for embeddings |
| python/packages/mistral/pyproject.toml | Defines the new package metadata, dependencies, and tooling config |
| python/packages/mistral/README.md | Documents installation and basic embedding usage |
| python/packages/mistral/AGENTS.md | Adds package-oriented usage notes/examples |
| python/.env.example | Adds Mistral env var placeholders |
| python/PACKAGE_STATUS.md | Registers the new package and its maturity status |
| .github/workflows/python-merge-tests.yml | Runs Mistral integration tests in merge workflow |
| .github/workflows/python-integration-tests.yml | Runs Mistral integration tests in scheduled/manual integration workflow |
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…ex, align docs Signed-off-by: Daria Korenieva <daric2612@gmail.com>
35e44c6 to
daf562e
Compare
Member
eavanvalkenburg
left a comment
There was a problem hiding this comment.
Looks really good, thanks for the work, just update to alpha status and remove the changes to integration tests, I will see if we can get mistral keys, so that we can enable that, but that will be a followup.
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
… - Change version to 1.0.0a260505 (alpha) - Update classifier to Development Status :: 3 - Alpha - Update PACKAGE_STATUS.md to alpha - Remove Mistral from integration test workflows (no API keys yet) Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…/microsoft-agent-framework into feature/mistral-embedding-client
…-management skill: alpha packages must include samples inside the package directory. Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…/microsoft-agent-framework into feature/mistral-embedding-client
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…edding-client # Conflicts: # python/uv.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Adds Mistral AI embedding support to the Python agent framework, as part of the Phase 9 additional embedding implementations tracked in #4171.
Mistral AI provides embedding models via their Python SDK. This PR adds a new agent-framework-mistral package with an embedding client that follows the same patterns established by the Ollama and OpenAI embedding clients.
Description
New package:
python/packages/mistral/MistralEmbeddingClient— embedding client with OpenTelemetry telemetry supportRawMistralEmbeddingClient— raw client without telemetry layerMistralEmbeddingOptions—TypedDictextendingEmbeddingGenerationOptionsfor Mistral-specific optionsMistralEmbeddingSettings—TypedDictfor env var resolution (MISTRAL_API_KEY,MISTRAL_EMBEDDING_MODEL,MISTRAL_SERVER_URL)Uses the
mistralaiSDK v2 (>=2.0.0,<3) withcreate_async()for async embedding generation. Maps Mistral's output_dimension parameter to the framework's dimensions option, and normalizes usage fields to input_token_count / total_token_count.Tests: 14 unit tests (100% coverage) + 1 integration test (skipped without API key).
CI: Added Mistral to the
python-tests-misc-integrationjob in bothpython-integration-tests.ymlandpython-merge-tests.yml. Integration tests will skip untilMISTRAL_API_KEY(secret) andMISTRAL_EMBEDDING_MODEL_ID(var) are provisioned in the GitHub integration environment.Dependency note:
mistralaipinsopentelemetry-semantic-conventions<0.61, but the workspace dev dependencyopentelemetry-sdk==1.40.0requires0.61b0. Resolved via override-dependencies inpyproject.toml. Safe at runtime; removable once mistralai relaxes the bound.
Contribution Checklist