Aspire.Milvus.Client 8.2.1-preview.1.24473.4

Prefix Reserved
This is a prerelease version of Aspire.Milvus.Client.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Aspire.Milvus.Client --version 8.2.1-preview.1.24473.4                
NuGet\Install-Package Aspire.Milvus.Client -Version 8.2.1-preview.1.24473.4                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Milvus.Client" Version="8.2.1-preview.1.24473.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Aspire.Milvus.Client --version 8.2.1-preview.1.24473.4                
#r "nuget: Aspire.Milvus.Client, 8.2.1-preview.1.24473.4"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Aspire.Milvus.Client as a Cake Addin
#addin nuget:?package=Aspire.Milvus.Client&version=8.2.1-preview.1.24473.4&prerelease

// Install Aspire.Milvus.Client as a Cake Tool
#tool nuget:?package=Aspire.Milvus.Client&version=8.2.1-preview.1.24473.4&prerelease                

Aspire.Milvus.Client library

Registers a MilvusClient in the DI container for connecting to a Milvus server.

Getting started

Prerequisites

  • Milvus server and connection string for accessing the server API endpoint.

Install the package

Install the .NET Aspire Milvus Client library with NuGet:

dotnet add package Aspire.Milvus.Client

Usage example

In the Program.cs file of your project, call the AddMilvusClient extension method to register a MilvusClient for use via the dependency injection container. The method takes a connection name parameter.

builder.AddMilvusClient("milvus");

Configuration

The .NET Aspire Milvus 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.AddMilvusClient():

builder.AddMilvusClient("milvus");

And then the connection string will be retrieved from the ConnectionStrings configuration section:

{
  "ConnectionStrings": {
    "milvus": "Endpoint=http://localhost:19530/;Key=root:123456!@#$%"
  }
}

By default the MilvusClient uses the gRPC API endpoint.

Use configuration providers

The .NET Aspire Milvus Client component supports Microsoft.Extensions.Configuration. It loads the MilvusSettings from configuration by using the Aspire:Milvus:Client key. Example appsettings.json that configures some of the options:

{
  "Aspire": {
    "Milvus": {
      "Client": {
        "Key": "root:123456!@#$%"
      }
    }
  }
}

Use inline delegates

Also you can pass the Action<MilvusSettings> configureSettings delegate to set up some or all the options inline, for example to set the API key from code:

builder.AddMilvusClient("milvus", settings => settings.Key = "root:12345!@#$%");

AppHost extensions

In your AppHost project, install the Aspire.Hosting.Milvus library with NuGet:

dotnet add package Aspire.Hosting.Milvus

Then, in the Program.cs file of AppHost, register a Milvus server and consume the connection using the following methods:

var milvus = builder.AddMilvus("milvus");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(milvus);

The WithReference method configures a connection in the MyService project named milvus. In the Program.cs file of MyService, the Milvus connection can be consumed using:

builder.AddMilvusClient("milvus");

Additional documentation

Feedback & contributing

https://github.com/dotnet/aspire

*Milvus and the Milvus logo are used with permission from the Milvus project. All rights reserved by LF AI & Data foundation.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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-preview.5.24551.3 39 11/12/2024
9.0.0-preview.4.24511.1 53 10/15/2024
8.2.2-preview.1.24521.5 57 10/24/2024
8.2.1-preview.1.24473.4 59 9/26/2024
8.2.0-preview.1.24428.5 45 8/29/2024
8.1.0-preview.1.24373.2 92 7/23/2024