Azure Semantic Reranker client library for .NET - version 1.0.0-beta.1

Important

Azure.Data.AI is a provisional package and namespace for the Semantic Reranker service. Product naming is not final.

Azure.Data.AI provides semantic reranking operations for .NET applications.

Getting started

Install the package

Install the client library for .NET with NuGet:

dotnet add package Azure.Data.AI --prerelease

Prerequisites

  • You must have a Microsoft Azure subscription.
  • A Semantic Reranker endpoint.
  • Either an API key or a Microsoft Entra identity assigned the Semantic Reranker User role on the Microsoft.InferenceService/inferenceAccounts resource.

Authenticate the client

Create a client with an API key:

Uri endpoint = new Uri("<semantic-reranker-endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<api-key>");
InferenceClient client = new InferenceClient(endpoint, credential);

Or authenticate with a TokenCredential, such as DefaultAzureCredential from Azure.Identity:

Uri endpoint = new Uri("<semantic-reranker-endpoint>");
InferenceClient client = new InferenceClient(endpoint, new DefaultAzureCredential());

The generated bearer-token policy requests the https://dbinference.azure.com/.default scope.

Key concepts

Use InferenceClient.SemanticRerank or SemanticRerankAsync to rerank documents directly.

Examples

See Semantic reranking.

Troubleshooting

Service operations throw RequestFailedException when the service returns a non-success status code.

Next steps

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (for example, label, comment). Follow the instructions provided by the bot. You'll only need to do this action once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact opencode@microsoft.com with any other questions or comments.