RAGToolkit.AI.VectorData.Abstractions
1.0.1
dotnet add package RAGToolkit.AI.VectorData.Abstractions --version 1.0.1
NuGet\Install-Package RAGToolkit.AI.VectorData.Abstractions -Version 1.0.1
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="RAGToolkit.AI.VectorData.Abstractions" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RAGToolkit.AI.VectorData.Abstractions" Version="1.0.1" />
<PackageReference Include="RAGToolkit.AI.VectorData.Abstractions" />
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 RAGToolkit.AI.VectorData.Abstractions --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RAGToolkit.AI.VectorData.Abstractions, 1.0.1"
#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 RAGToolkit.AI.VectorData.Abstractions@1.0.1
#: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=RAGToolkit.AI.VectorData.Abstractions&version=1.0.1
#tool nuget:?package=RAGToolkit.AI.VectorData.Abstractions&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RAGToolkit.AI.VectorData.Abstractions
稀疏向量的契约与数据模型。不含任何 provider 实现。
核心类型
| 类型 | 说明 |
|---|---|
SparseEmbedding |
稀疏向量:Indices(ReadOnlyMemory<int>)+ Values(ReadOnlyMemory<float>),继承 Embedding |
ISparseEmbeddingGenerator<TInput> |
稀疏嵌入生成器 —— 就是 IEmbeddingGenerator<TInput, SparseEmbedding> |
VectorStoreSparseVectorAttribute |
标在源文本属性上,告诉 provider"这个字段要产稀疏向量" |
VectorStoreSparseVectorProperty |
命令式版本:不想用特性标注时,直接构造它交给 provider |
为什么需要它
Microsoft.Extensions.VectorData 目前没有稀疏向量的一等模型:
VectorStoreProperty不可外部继承,provider 没法自己扩一个"稀疏向量属性";VectorStoreRecordDefinition也不认识稀疏。
所以这里用平行的一套类型做桥接。等上游补上之后,这层可以退役。
示例
using RAGToolkit.AI.VectorData;
// 特性式:被标注的属性名就是稀疏向量的来源字段
public sealed class Doc
{
[VectorStoreData]
[VectorStoreSparseVector(StorageName = "sparse")]
public string Content { get; set; } = "";
}
// 命令式
var sparseProperty = new VectorStoreSparseVectorProperty("Content")
{
StorageName = "sparse",
};
依赖
Microsoft.Extensions.AI.AbstractionsMicrosoft.Extensions.VectorData.Abstractions
许可证
MIT —— 见 LICENSE。
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.0
- Microsoft.Extensions.AI.Abstractions (>= 10.10.1)
- Microsoft.Extensions.VectorData.Abstractions (>= 10.10.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on RAGToolkit.AI.VectorData.Abstractions:
| Package | Downloads |
|---|---|
|
RAGToolkit.AI.VectorData.Qdrant
Experimental Qdrant vector store provider for RAGToolkit.AI.VectorData, based on the Semantic Kernel Qdrant connector. |
|
|
RAGToolkit.AI.VectorData.Tei
Text Embeddings Inference provider for sparse embedding generation. |
GitHub repositories
This package is not used by any popular GitHub repositories.