Python: Add Mistral AI embedding client package#5480
Conversation
|
@eavanvalkenburg please review when you have time — this implements the Mistral AI embedding client from #4171. |
fc9c4de to
39b15eb
Compare
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 |
35e44c6 to
daf562e
Compare
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.
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
…ex, align docs Signed-off-by: Daria Korenieva <daric2612@gmail.com>
… - 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>
…-management skill: alpha packages must include samples inside the package directory. Signed-off-by: Daria Korenieva <daric2612@gmail.com>
ca93152 to
4d2b5de
Compare
Signed-off-by: Daria Korenieva <daric2612@gmail.com>
4d2b5de to
791cadb
Compare
|
@eavanvalkenburg please review when you have time - I have addressed your comments above. |
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