[WIP][EGS]: Add azure-cosmos-ai companion package with Azure OpenAI embedding provider#47003
Open
aayush3011 wants to merge 10 commits into
Open
[WIP][EGS]: Add azure-cosmos-ai companion package with Azure OpenAI embedding provider#47003aayush3011 wants to merge 10 commits into
aayush3011 wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new sibling package, azure-cosmos-ai (1.0.0b1), which provides a default Azure OpenAI-backed implementation of the EmbeddingProvider contract used by azure-cosmos to generate vector embeddings for GenerateEmbeddings(...) query expressions.
Changes:
- Adds new
azure-cosmos-aipackage with sync/asyncAzureOpenAIEmbeddingProvider, credential support, endpoint-based client caching, and close/context-manager behavior. - Adds unit tests (mocked) plus opt-in live tests, and provides samples + README + changelog for the new package.
- Updates Cosmos service CI artifact list to include
azure-cosmos-ai.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/ci.yml | Adds azure-cosmos-ai to the Cosmos CI artifact list. |
| sdk/cosmos/azure-cosmos-ai/tests/test_azure_openai_provider.py | Sync unit + opt-in live tests for the provider. |
| sdk/cosmos/azure-cosmos-ai/tests/test_azure_openai_provider_async.py | Async unit + opt-in live tests for the provider. |
| sdk/cosmos/azure-cosmos-ai/tests/conftest.py | Test-time stub injection for EmbeddingResult (for local/CI compatibility). |
| sdk/cosmos/azure-cosmos-ai/setup.py | Package setup/configuration and dependencies. |
| sdk/cosmos/azure-cosmos-ai/sdk_packaging.toml | Packaging automation configuration. |
| sdk/cosmos/azure-cosmos-ai/samples/sample_embedding_provider.py | Sync usage sample showing API key and Entra scenarios. |
| sdk/cosmos/azure-cosmos-ai/samples/sample_embedding_provider_async.py | Async usage sample showing API key and Entra scenarios. |
| sdk/cosmos/azure-cosmos-ai/README.md | Package overview, examples, credential matrix, troubleshooting notes. |
| sdk/cosmos/azure-cosmos-ai/pyproject.toml | Enables repo build checks (mypy/pylint) for this package. |
| sdk/cosmos/azure-cosmos-ai/MANIFEST.in | Source distribution include rules (samples/tests/namespace files/py.typed). |
| sdk/cosmos/azure-cosmos-ai/LICENSE | MIT license file for the package. |
| sdk/cosmos/azure-cosmos-ai/dev_requirements.txt | Dev dependencies for local builds/tests. |
| sdk/cosmos/azure-cosmos-ai/CHANGELOG.md | Initial release entry for 1.0.0b1 (Unreleased). |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/py.typed | Marks the package as typed. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/aio/_azure_openai_provider.py | Async Azure OpenAI provider implementation. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/aio/init.py | Exposes async provider class. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/_version.py | Package version constant. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/_azure_openai_provider.py | Sync Azure OpenAI provider implementation. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/ai/init.py | Exposes provider + __version__. |
| sdk/cosmos/azure-cosmos-ai/azure/cosmos/init.py | Introduces an azure.cosmos package initializer (namespace-style). |
| sdk/cosmos/azure-cosmos-ai/azure/init.py | Introduces an azure package initializer (namespace-style). |
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.
Description
Introduces a new sibling package, azure-cosmos-ai (1.0.0b1), that ships the default Azure OpenAI implementation of the EmbeddingProvider Protocol introduced in azure-cosmos 4.16.0b3. The provider is used by the Cosmos SDK to generate vector embeddings at query time for
GenerateEmbeddings(...)expressions on containers whosevectorEmbeddingPolicy.embeddingSourcepoints at an Azure OpenAI deployment.What's in the package
Tests
Each test module exposes two pytest classes:
Related
Companion to the EGSInterface and EGSPolicy work on azure-cosmos (EmbeddingProvider Protocol, EmbeddingResult dataclass, and the new embeddingSource fields on VectorEmbeddingPolicy).
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines