CyberEye.CommonAi.Lib 3.0.34

dotnet add package CyberEye.CommonAi.Lib --version 3.0.34
                    
NuGet\Install-Package CyberEye.CommonAi.Lib -Version 3.0.34
                    
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="CyberEye.CommonAi.Lib" Version="3.0.34" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CyberEye.CommonAi.Lib" Version="3.0.34" />
                    
Directory.Packages.props
<PackageReference Include="CyberEye.CommonAi.Lib" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add CyberEye.CommonAi.Lib --version 3.0.34
                    
#r "nuget: CyberEye.CommonAi.Lib, 3.0.34"
                    
#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.
#:package CyberEye.CommonAi.Lib@3.0.34
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=CyberEye.CommonAi.Lib&version=3.0.34
                    
Install as a Cake Addin
#tool nuget:?package=CyberEye.CommonAi.Lib&version=3.0.34
                    
Install as a Cake Tool

CyberEye.CommonAi.Lib

Client Chat và Embedding qua HTTP OpenAI-compatible. Embedding có batching, loại bỏ đầu vào trùng, cache hai tầng và trạng thái Circuit Breaker.

Target framework: net8.0.

Cài đặt

dotnet add package CyberEye.CommonAi.Lib

Cần cấu hình NuGet feed của dự án và chọn phiên bản tương thích với các package CyberEye khác trong host.

Đăng ký và cấu hình

using Ce.CommonAi.Lib.StartupExtensions;
builder.Services.AddCommonAiServices(builder.Configuration);
{
  "Ai": {
    "Chat": { "Enabled": false },
    "Embedding": {
      "Enabled": true,
      "Endpoint": "http://localhost:11434/v1",
      "Model": "bge-m3",
      "Dimensions": 1024,
      "BatchSize": 32,
      "Cache": { "Enabled": false }
    }
  }
}

Model phải tồn tại trên inference server; Dimensions phải phù hợp model và index. Khi chạy container, localhost là chính container đó.

Sử dụng

Inject Ce.CommonAi.Lib.Abstractions.IEmbeddingService, rồi gọi EmbedAsync(text, ct) hoặc EmbedManyAsync(texts, ct). Package không có IAiEmbeddingClient.

Tier1 dùng AsyncLocal theo luồng async; tier2 dùng IDistributedCache (memory hoặc Redis theo cấu hình). BatchSize chia danh sách đầu vào thành lô, không phải cam kết tự gom mọi request HTTP đồng thời.

IEmbeddingHealth phản ánh trạng thái Circuit Breaker. Consumer chọn cách fallback; package không tự đổi mọi truy vấn tìm kiếm thành BM25. Khi embedding tắt, NullEmbeddingService trả zero vector đúng số chiều.

Metrics collector thuộc Ce.Observability.Lib và phải được bật riêng.

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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.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
3.0.34 0 11/15/2026
3.0.33 0 11/15/2026
3.0.32 0 11/15/2026
3.0.31 37 11/15/2026
3.0.30 47 11/15/2026
3.0.29 49 11/13/2026
3.0.28 99 11/6/2026
3.0.27 151 9/17/2026
3.0.26 118 9/8/2026
3.0.25 134 8/22/2026
3.0.24 134 8/10/2026
3.0.23 130 8/9/2026
3.0.22 146 8/1/2026
3.0.21 134 7/28/2026
3.0.20 152 7/27/2026
3.0.19 139 7/27/2026
3.0.18 126 7/17/2026
3.0.17 131 7/13/2026
3.0.16 137 7/12/2026
3.0.15 131 7/10/2026
Loading failed