Aspire.Qdrant.Client
8.2.1
Prefix Reserved
See the version list below for details.
dotnet add package Aspire.Qdrant.Client --version 8.2.1
NuGet\Install-Package Aspire.Qdrant.Client -Version 8.2.1
<PackageReference Include="Aspire.Qdrant.Client" Version="8.2.1" />
paket add Aspire.Qdrant.Client --version 8.2.1
#r "nuget: Aspire.Qdrant.Client, 8.2.1"
// Install Aspire.Qdrant.Client as a Cake Addin #addin nuget:?package=Aspire.Qdrant.Client&version=8.2.1 // Install Aspire.Qdrant.Client as a Cake Tool #tool nuget:?package=Aspire.Qdrant.Client&version=8.2.1
Aspire.Qdrant.Client library
Registers a QdrantClient in the DI container for connecting to a Qdrant server.
Getting started
Prerequisites
- Qdrant server and connection string for accessing the server API endpoint.
Install the package
Install the .NET Aspire Qdrant Client library with NuGet:
dotnet add package Aspire.Qdrant.Client
Usage example
In the Program.cs file of your project, call the AddQdrantClient
extension method to register a QdrantClient
for use via the dependency injection container. The method takes a connection name parameter.
builder.AddQdrantClient("qdrant");
Configuration
The .NET Aspire Qdrant Client component provides multiple options to configure the server connection based on the requirements and conventions of your project.
Use a connection string
When using a connection string from the ConnectionStrings
configuration section, you can provide the name of the connection string when calling builder.AddQdrantClient()
:
builder.AddQdrantClient("qdrant");
And then the connection string will be retrieved from the ConnectionStrings
configuration section:
{
"ConnectionStrings": {
"qdrant": "Endpoint=http://localhost:6334;Key=123456!@#$%"
}
}
By default the QdrantClient
uses the gRPC API endpoint.
Use configuration providers
The .NET Aspire Qdrant Client component supports Microsoft.Extensions.Configuration. It loads the QdrantSettings
from configuration by using the Aspire:Qdrant:Client
key. Example appsettings.json
that configures some of the options:
{
"Aspire": {
"Qdrant": {
"Client": {
"Key": "123456!@#$%"
}
}
}
}
Use inline delegates
Also you can pass the Action<QdrantSettings> configureSettings
delegate to set up some or all the options inline, for example to set the API key from code:
builder.AddQdrantClient("qdrant", settings => settings.ApiKey = "12345!@#$%");
AppHost extensions
In your AppHost project, install the Aspire.Hosting.Qdrant
library with NuGet:
dotnet add package Aspire.Hosting.Qdrant
Then, in the Program.cs file of AppHost
, register a Qdrant server and consume the connection using the following methods:
var qdrant = builder.AddQdrant("qdrant");
var myService = builder.AddProject<Projects.MyService>()
.WithReference(qdrant);
The WithReference
method configures a connection in the MyService
project named qdrant
. In the Program.cs file of MyService
, the Qdrant connection can be consumed using:
builder.AddQdrantClient("qdrant");
Additional documentation
- https://github.com/qdrant/qdrant-dotnet
- https://github.com/dotnet/aspire/tree/main/src/Components/README.md
Feedback & contributing
https://github.com/dotnet/aspire
Qdrant, and the Qdrant logo are trademarks or registered trademarks of Qdrant Solutions GmbH of Germany, and used with their permission.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Google.Protobuf (>= 3.28.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 8.0.2)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Hosting.Abstractions (>= 8.0.0)
- Microsoft.Extensions.Logging.Abstractions (>= 8.0.1)
- Microsoft.Extensions.Options (>= 8.0.2)
- Microsoft.Extensions.Primitives (>= 8.0.0)
- Qdrant.Client (>= 1.11.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
9.0.0 | 186 | 11/12/2024 |
9.0.0-rc.1.24511.1 | 239 | 10/15/2024 |
8.2.2 | 280 | 10/24/2024 |
8.2.1 | 366 | 9/26/2024 |
8.2.0 | 758 | 8/29/2024 |
8.1.0 | 211 | 7/23/2024 |
8.0.2 | 412 | 6/28/2024 |
8.0.1 | 593 | 5/21/2024 |
8.0.0 | 111 | 5/21/2024 |
8.0.0-preview.7.24251.11 | 65 | 5/7/2024 |
8.0.0-preview.6.24214.1 | 84 | 4/23/2024 |