XiHan.Framework.AI.Abstractions 5.0.0-rc.5

Prefix Reserved
This is a prerelease version of XiHan.Framework.AI.Abstractions.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package XiHan.Framework.AI.Abstractions --version 5.0.0-rc.5
                    
NuGet\Install-Package XiHan.Framework.AI.Abstractions -Version 5.0.0-rc.5
                    
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="XiHan.Framework.AI.Abstractions" Version="5.0.0-rc.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XiHan.Framework.AI.Abstractions" Version="5.0.0-rc.5" />
                    
Directory.Packages.props
<PackageReference Include="XiHan.Framework.AI.Abstractions" />
                    
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 XiHan.Framework.AI.Abstractions --version 5.0.0-rc.5
                    
#r "nuget: XiHan.Framework.AI.Abstractions, 5.0.0-rc.5"
                    
#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 XiHan.Framework.AI.Abstractions@5.0.0-rc.5
                    
#: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=XiHan.Framework.AI.Abstractions&version=5.0.0-rc.5&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=XiHan.Framework.AI.Abstractions&version=5.0.0-rc.5&prerelease
                    
Install as a Cake Tool

XiHan.Framework.AI.Abstractions

关于

XiHan.Framework.AI.Abstractions 定义 AI 的统一入口:以 Microsoft.Extensions.AI 的 IChatClient、IEmbeddingGenerator 为基础,提供模型目录、带提示词与护栏的聊天、把操作暴露成模型工具,以及知识库(RAG)流水线。它还自带进程内的工具目录。

主要特性

  • 按名字解析聊天与嵌入模型,默认模型随配置
  • 聊天入口统一处理提示词、护栏、工具与超时
  • Expose.Ai 的操作自动成为模型可调用的工具
  • 知识库摄入、检索与提示增强,存储由提供程序实现

如何使用

安装

dotnet add package XiHan.Framework.AI.Abstractions --prerelease

使用

通常由实现包带入;写业务代码或自定义提供程序时才直接引用。模型由 XiHan.Framework.AI.OpenAI 提供,知识库存储由 XiHan.Framework.AI.VectorData 提供。其他组合里启用工具目录并调用聊天入口:

builder.AddXiHan(xihan => xihan
    .UseStandardProfile()
    .UseFeature<AIToolsFeature>());
var reply = await chat.CompleteAsync(new AIChatRequest
{
    Messages = [new ChatMessage(ChatRole.User, "How many orders are pending?")],
    Prompt = "assistant",
    Tools = ["orders_list"],
}, ct);

主要类型

此库提供的主要类型:

  • IAIChat、AIChatRequest:聊天入口,CompleteAsync / StreamAsync
  • IAIProviderCatalog:按名字解析聊天与嵌入客户端
  • IAIPromptCatalog、AIPromptTemplate:提示词模板
  • IAIGuardrail、KeywordBlocklistGuardrail:输入与输出护栏
  • IAIToolCatalog:工具目录
  • IKnowledgeIngestor、IKnowledgeRetriever、IKnowledgeStore:知识库流水线与存储契约

更多文档

相关包

反馈与贡献

XiHan.Framework.AI.Abstractions 以 MIT 许可证 开源。欢迎到 GitHub 仓库 提交问题和贡献。

Product 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.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on XiHan.Framework.AI.Abstractions:

Package Downloads
XiHan.Framework.AI

曦寒框架 AI 扩展库

XiHan.Framework.AI.OpenAI

曦寒框架 AI 的 OpenAI 兼容提供程序

XiHan.Framework.Profiles.Full

曦寒框架 Full 组合包

XiHan.Framework.AI.VectorData

曦寒框架 AI 知识库的向量存储提供程序

XiHan.Framework.AI.Conformance

曦寒框架 AI 一致性测试套件

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0-rc.7 137 11/23/2026
5.0.0-rc.6 272 11/21/2026
5.0.0-rc.5 102 11/20/2026
5.0.0-rc.4 85 11/19/2026
5.0.0-rc.3 76 11/19/2026
5.0.0-rc.2 85 11/15/2026
5.0.0-rc.1 226 11/13/2026
5.0.0-preview.3 102 11/11/2026
5.0.0-preview.2 125 11/6/2026
5.0.0-preview.1 82 11/4/2026
4.8.0 224 10/22/2026
4.7.1 125 10/21/2026
4.7.0 155 10/15/2026
4.6.2 133 10/13/2026
4.6.1 302 10/3/2026
4.6.0 155 9/25/2026
4.5.0 137 9/23/2026
4.4.0 142 9/22/2026
4.3.0 157 9/12/2026
4.2.0 185 9/4/2026
Loading failed