Adding embedding policy changes for EGS#46870
Open
aayush3011 wants to merge 5 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Documents and adds test coverage for the new optional embeddingSource object on entries in vector_embedding_policy.vectorEmbeddings for Azure Cosmos DB. No SDK code logic changes were needed since vector_embedding_policy is passed through as a dict.
Changes:
- Adds README section and docstring updates in sync/async
database.pydescribing the newembeddingSourcefields (sourcePaths,deploymentName,modelName,endpoint,authType). - Adds new sync and async tests verifying round-trip of an
embeddingSourcepolicy for bothApiKeyandEntraauth types, plus a negative test for an invalidauthType. - Adds a CHANGELOG entry under the 4.16.0b3 (Unreleased) section.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/CHANGELOG.md | Documents the new optional embeddingSource field. |
| sdk/cosmos/azure-cosmos/README.md | Adds a sample policy snippet showing embeddingSource usage. |
| sdk/cosmos/azure-cosmos/azure/cosmos/database.py | Extends docstrings of all create_container/create_container_if_not_exists overloads. |
| sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py | Same docstring extensions for the async client. |
| sdk/cosmos/azure-cosmos/tests/test_vector_policy.py | Adds positive (ApiKey/Entra) and negative (invalid authType) sync tests. |
| sdk/cosmos/azure-cosmos/tests/test_vector_policy_async.py | Adds equivalent async tests. |
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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
Adds documentation and test coverage for the new optional embeddingSource object on vectorEmbeddingPolicy, which allows the service to compute embeddings on the server side from one or more source paths.
New embeddingSource fields:
No SDK code changes were required: vector_embedding_policy is passed through as a dict, so the new fields flow to the service without modification.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines