Semantic Rerank: Adds Semantic Rerank API#5445
Merged
microsoft-github-policy-service[bot] merged 43 commits intomasterfrom Nov 24, 2025
Merged
Semantic Rerank: Adds Semantic Rerank API#5445microsoft-github-policy-service[bot] merged 43 commits intomasterfrom
microsoft-github-policy-service[bot] merged 43 commits intomasterfrom
Conversation
milismsft
previously approved these changes
Oct 22, 2025
milismsft
reviewed
Oct 22, 2025
milismsft
left a comment
There was a problem hiding this comment.
Please try to address the potential multiple background tasks related to the Interference object (and proper dispose of that task as well) :-)
aayush3011
requested changes
Oct 25, 2025
Member
There was a problem hiding this comment.
@NaluTripician LGTM, added the comments, that we discussed offline.
Microsoft.Azure.Cosmos/src/RequestOptions/SemanticRerankRequestOptions.cs
Outdated
Show resolved
Hide resolved
Microsoft.Azure.Cosmos/src/Resource/Container/ContainerInlineCore.cs
Outdated
Show resolved
Hide resolved
This was referenced Feb 3, 2026
[nuget] Bump Microsoft.Azure.Cosmos from 3.52.0 to 3.57.0
felipementel/DEPLOY.CosmosDBForNoSQL-v1#11
Open
Open
This was referenced Feb 13, 2026
This was referenced Feb 23, 2026
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.
Pull Request Template
Description
This pull request introduces a new semantic reranking feature to the Azure Cosmos DB .NET SDK, enabling users to rerank documents using an inference service that leverages Azure Active Directory (AAD) authentication. The main changes include the addition of the
InferenceServiceclass, new API surface for semantic reranking, and appropriate integration into the SDK's authorization and client context infrastructure. Notably, this functionality is only available when using AAD authentication.Semantic Reranking Feature Integration:
InferenceServiceclass, which handles communication with the Cosmos DB Inference Service for semantic reranking, including HTTP client configuration, payload construction, and response handling. This service enforces AAD authentication and manages its own authorization and disposal.PREVIEW) or internal APISemanticRerankAsyncto theContainerclass, allowing users to rerank a list of documents based on a context/query string. This is implemented inContainerInlineCoreand routed through the client context. [1] [2]Authorization and Token Handling Updates:
AuthorizationTokenProviderabstraction and its implementations to support a new method,AddInferenceAuthorizationHeaderAsync, which is only valid for AAD-based token providers. Non-AAD providers throw aNotImplementedExceptionfor this method. [1] [2] [3] [4] [5] [6]Client Context and Resource Management:
ClientContextCoreandCosmosClientContextto manage the lifecycle of theInferenceService, including creation, caching, and disposal. Added methods for invoking semantic reranking and for retrieving or creating the inference service instance. [1] [2] [3] [4] [5] [6]Dependency Updates:
Azure.Identitypackage in the test project to support AAD authentication scenarios.Please delete options that are not relevant.
Example
Closing issues
To automatically close an issue: closes #IssueNumber