Skip to content

Adding embedding policy changes for EGS#46870

Open
aayush3011 wants to merge 5 commits into
Azure:mainfrom
aayush3011:users/akataria/EGSPolicy
Open

Adding embedding policy changes for EGS#46870
aayush3011 wants to merge 5 commits into
Azure:mainfrom
aayush3011:users/akataria/EGSPolicy

Conversation

@aayush3011
Copy link
Copy Markdown
Member

@aayush3011 aayush3011 commented May 13, 2026

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:

  • sourcePaths – list of document paths to embed
  • deploymentName – embedding model deployment name
  • modelName – embedding model name
  • endpoint – embedding service endpoint
  • authType – ApiKey or Entra

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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@aayush3011 aayush3011 marked this pull request as ready for review May 13, 2026 21:02
@aayush3011 aayush3011 requested a review from a team as a code owner May 13, 2026 21:02
Copilot AI review requested due to automatic review settings May 13, 2026 21:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py describing the new embeddingSource fields (sourcePaths, deploymentName, modelName, endpoint, authType).
  • Adds new sync and async tests verifying round-trip of an embeddingSource policy for both ApiKey and Entra auth types, plus a negative test for an invalid authType.
  • 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.

Comment thread sdk/cosmos/azure-cosmos/CHANGELOG.md Outdated
@aayush3011 aayush3011 requested a review from Copilot May 13, 2026 21:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

Comment thread sdk/cosmos/azure-cosmos/tests/test_vector_policy.py Outdated
Comment thread sdk/cosmos/azure-cosmos/tests/test_vector_policy.py Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

@aayush3011
Copy link
Copy Markdown
Member Author

/azp run python - cosmos - tests

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants