Senparc.Xncf.AIKernel
0.16.3
Prefix Reserved
See the version list below for details.
dotnet add package Senparc.Xncf.AIKernel --version 0.16.3
NuGet\Install-Package Senparc.Xncf.AIKernel -Version 0.16.3
<PackageReference Include="Senparc.Xncf.AIKernel" Version="0.16.3" />
<PackageVersion Include="Senparc.Xncf.AIKernel" Version="0.16.3" />
<PackageReference Include="Senparc.Xncf.AIKernel" />
paket add Senparc.Xncf.AIKernel --version 0.16.3
#r "nuget: Senparc.Xncf.AIKernel, 0.16.3"
#:package Senparc.Xncf.AIKernel@0.16.3
#addin nuget:?package=Senparc.Xncf.AIKernel&version=0.16.3
#tool nuget:?package=Senparc.Xncf.AIKernel&version=0.16.3
Senparc.Xncf.AIKernel
Senparc.Xncf.AIKernel is the NCF AI model and vector configuration module. It provides persistence, administration services, and integration helpers for Senparc AI model settings.
Features
- Manages
AIModelandAIVectorrecords and their DTO/request models. - Provides model and vector application services with paging, create, edit, and delete operations.
- Builds
SenparcAiSettingvalues and runs model requests through the configured Senparc AI runtime. - Monitors AI token usage with real-time in-process aggregation (
AITokenMonitorService) and persistent, queryable usage records (AITokenUsageService). - Separates real-time token totals and run-progress buffers by the resolved tenant; monitor endpoints read only the current tenant's partition.
- Publishes per-run token progress as asynchronous events consumable via
IAsyncEnumerable(SubscribeAsync), with buffered replay for late subscribers. - Surfaces token usage on the AI model list page: overview cards (total tokens / calls / success-error / average duration), per-model usage columns (calls, total tokens with relative bar, last used), alias search, and a shortcut to the Token Monitor page.
- Synchronizes model metadata from NeuChar services when explicitly requested.
- Supports NCF's multi-database context variants and localized module metadata.
Installation
<PackageReference Include="Senparc.Xncf.AIKernel" Version="0.26.0-preview3" />
Key API
AIModelService.AddAsync(...),EditAsync(...), andBuildSenparcAiSetting(...)manage model configuration.AIModelService.RunModelsync(...)executes a configured model request.AIModelService.UpdateModelsFromNeuCharAsync(...)refreshes model metadata from NeuChar.AIVectorService.AddAsync(...)andEditAsync(...)manage vector configuration.AITokenMonitorService.Record(...)accumulates per-call token totals (overall / by model / by day) thread-safely;GetLiveStats(...)returns the aggregatedAITokenMonitorStats.AITokenMonitorService.PublishProgress(...)andSubscribeAsync(runId, ...)expose asynchronous per-run token progress as anIAsyncEnumerable<AITokenProgressEvent>with buffered replay.AITokenUsageService.RecordAsync(...)andGetStatsAsync(...)persist usage records and compute aggregate statistics;AITokenUsageSnapshot.Normalize()fills a missing total from input + output.AITokenUsageService.GetModelUsageMapAsync(...)returns per-model usage aggregates (viaTokenUsageAggregator) used byAIModelAppServiceto attachAIModelDto.Usageon the model list.AIModelAppServiceandAIVectorAppServiceexpose NCF function/application endpoints;AIModelStudioAppServiceis the model-studio integration point.
Testing
Senparc.Xncf.AIKernel.Tests (MSTest) covers the token-monitoring surface:
AITokenUsageSnapshotTests- normalization, total fallback, and empty detection.AITokenProgressEventTests- completion-state derivation.AITokenMonitorServiceRecordTests- real-time aggregation (overall / by model / by day), clamping, and concurrency safety.AITokenMonitorServiceProgressTestsandAITokenMonitorServiceAsyncProgressTests- buffered replay, liveIAsyncEnumerablesubscription, multi-subscriber delivery, burst/concurrent delivery, and cancellation.
dotnet test src/Extensions/Senparc.Xncf.AIKernel.Tests/Senparc.Xncf.AIKernel.Tests.csproj
The module stores provider settings and may process prompts or model output. Keep API keys in secure configuration, restrict model administration, and apply tenant/data-retention rules before enabling it for users.
| 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. |
-
net10.0
- Microsoft.Agents.AI (>= 1.8.0)
- Microsoft.Agents.AI.Abstractions (>= 1.8.0)
- Microsoft.Agents.AI.Harness (>= 1.8.0-preview.260528.1)
- Microsoft.Extensions.AI.OpenAI (>= 10.5.1)
- Microsoft.Extensions.FileProviders.Embedded (>= 10.0.2)
- OllamaSharp (>= 5.4.25)
- OpenAI (>= 2.10.0)
- Senparc.AI (>= 0.27.4)
- Senparc.AI.AgentKernel (>= 0.1.14-preview5)
- Senparc.AI.Kernel (>= 0.29.1)
- Senparc.CO2NET.WebApi (>= 2.1.9-preview)
- Senparc.Ncf.AreaBase (>= 0.23.9)
- Senparc.Ncf.DatabasePlant (>= 0.21.13)
- Senparc.Ncf.XncfBase (>= 0.28.1)
- Senparc.NeuChar.App (>= 1.6.0)
- System.ClientModel (>= 1.11.0)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Senparc.Xncf.AIKernel:
| Package | Downloads |
|---|---|
|
Senparc.Xncf.XncfBuilder
Senparc.Xncf.XncfBuilder 快速生成 XNCF 模块基础程序代码 |
|
|
Senparc.Xncf.PromptRange
你的提示词(Prompt)训练场 |
|
|
Senparc.Xncf.MCP
Model Context Protocol(MCP) Manager |
|
|
Senparc.Xncf.KnowledgeBase
AI 知识库 |
|
|
Senparc.Xncf.AIAgentsHub
人工智能代理枢纽模块 |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.16.4 | 60 | 10/10/2026 |
| 0.16.3 | 101 | 10/4/2026 |
| 0.16.2 | 132 | 9/18/2026 |
| 0.16.1 | 116 | 9/16/2026 |
| 0.16.0 | 110 | 9/15/2026 |
| 0.15.5 | 183 | 8/29/2026 |
| 0.15.4 | 285 | 8/23/2026 |
| 0.15.3-preview12 | 185 | 8/14/2026 |
| 0.15.3-preview10 | 171 | 8/12/2026 |
| 0.15.2-preview9 | 177 | 8/8/2026 |
| 0.15.1-preview8 | 197 | 8/3/2026 |
| 0.15.0-preview7 | 194 | 7/31/2026 |
| 0.14.1-preview6 | 172 | 7/28/2026 |
| 0.14.0-preview5 | 163 | 7/26/2026 |
| 0.13.5-preview4 | 138 | 7/15/2026 |
| 0.13.4-preview3 | 112 | 7/5/2026 |
| 0.13.2-preview1 | 132 | 7/3/2026 |
| 0.13.1-preview1 | 162 | 6/17/2026 |
| 0.12.26.1-preview | 244 | 5/9/2026 |
| 0.12.2-preview | 147 | 6/16/2026 |
[2026-10-01] v0.16.3 按租户隔离实时 Token 统计与运行进度
1、实时聚合、模型统计和日期统计按可信租户上下文分区
2、运行进度缓冲与查询按租户校验,阻止跨租户读取
v0.1.0 创世
v0.1.3 升级 Senparc.AI,提供多模型配
v0.2.0 升级 Senparc.AI,添加 FastAPI 模式
v0.3.0 添加 Function 方式的 AI模型调用
v0.3.3 升级 Senparc.AI,优化模型调用,支持流式输出
v0.5.2 升级 Senparc.AI,支持新格式模型配置
v0.5.3.1 添加 AIKernelAutoMapperProfile 映射
v0.8.3 支持 Ollama
[2024-08-06] v0.8.6-preview1 update Senparc.AI.Kernel
[2024-08-28] v0.8.9 添加 NeuChar 模型获取接口
[2024-08-18] v0.8.10 NeuCharAI 模型提供快速选择;解决 Chat/TextCompetion 编辑选中 bug
[2024-08-28] v0.8.10.6-preview1 完善 NeuChar AI 云端模型自动载入
[2024-08-28] v0.8.10.7-preview1 完善 NeuChar AI 云端模型自动载入
[2024-08-28] v0.8.10.11-preview1 完善 NeuChar AI 模型同步提示
[2024-08-31] v0.9.0-preview1 PromptRange 支持 Markdown 输出格式展示
[2024-09-03] v0.9.1-preview1 PromptRange 结果提供“复制”功能
[2024-09-07] v0.9.2-preview1 更新 Senparc.AI 基础库,并在 XncfBuilder 使用 AI 生成代码时,优先使用已选中的模型。
[2024-09-10] v0.9.3-preview1 升级缓存基础库
[2024-10-09] v0.9.5-preview1 升级基础库
[2024-10-16] v0.9.6-preview1 添加 Service 对 PagedList 对象快速 Mapping 到 DTO 对象的方法
[2024-11-04] v0.10.0-preview1 重构 PromptRange 界面;大幅提升树状 Prompt 检索性能(约20倍)
[2024-11-08] v0.10.1-preview1 升级 Senparc.AI
[2024-11-15] v0.11.0-preview1 使用新版本 AutoGen,升级 AgentsManager;解决 AgentsManager 中状态获取的异常
[2024-11-21] v0.12.2-preview1 更新 CO2NET 及缓存基础库
[2024-11-28] v0.12.3-preview1 update CO2NET, use new SenparcSetting with UseLowerCaseApiName property
[2024-12-27] v0.12.4-preview1 Add exception log for UseXncfModules() auto progress
[2025-01-25] v0.12.8-preview1 Update Agents functions, support for function calling
[2025-01-28] v0.12.9-preview1 update Senparc.AI
[2025-02-06] v0.12.11-preview1 update NeuCharAI model update
[2025-02-08] v0.12.12-preview1 add optional parameter to RunModelsync
[2025-02-22] v0.12.13-preview1 add DeepSeek-R1 model option
[2025-04-29] v0.12.16-preview1 Update CO2NET and AIKernel
[2025-04-29] v0.12.17-preview1 Update CO2NET and AIKernel
[2025-05-18] v0.12.18-preview1 Update Installation
[2025-06-20] v0.12.20-preview Add MCP functions in XncfRegisterBase class
[2026-03-24] v0.12.24-preview.1 update Senparc.AI.Kernel to v0.28.0
[2026-04-24] Simplify FunctionRender request parameters and keep SelectionList UI metadata compatibility
[2026-07-02] v0.13.2-preview1 支持流式输出并优化交互体验,新增 PromptRange 与 AgentsManager 使用记录能力
1、支持流式输出并优化交互体验
2、新增 PromptRange 与 AgentsManager 使用记录能力
[2026-07-05] v0.13.3-preview2 修复 AI 模型类型展示顺序,重构系统配置初始化与更新流程并统一模型处理
1、修复 AI 模型类型展示顺序
2、重构系统配置初始化与更新流程并统一模型处理
[2026-07-05] v0.13.4-preview3 修复 AI 模型类型展示顺序,重构系统配置初始化与更新流程并统一模型处理
1、修复 AI 模型类型展示顺序
2、重构系统配置初始化与更新流程并统一模型处理
3、统一后台模型配置与模型类型映射处理,增强模型初始化与异常处理一致性
[2026-07-07] v0.13.5-preview4 统一模型名称构建并补齐 Embedding 维度兼容处理
1、重构 AIModelService 的统一 ModelName 组装逻辑,补齐 TextToSpeech 与 SpeechToText 模型字段
2、新增 EmbeddingDimensions 自动解析与兜底策略,提升 embedding 模型兼容性与稳定性
3、升级 Senparc.AI 至 0.27.3、Senparc.AI.AgentKernel 至 0.1.10
[2026-07-17] v0.14.0-preview5 为 AIKernel 模块接入统一资源本地化并优化功能文案
1、接入统一资源本地化机制,支持模块功能文案按当前文化动态显示
2、更新 FunctionRender 与请求模型文案的资源化解析
3、统一模块注册信息、菜单名称与功能描述的本地化输出
4、同步管理页面与前端交互文案的多语言显示
5、同步 NeuChar 模型的 ApiVersion 到本地模型配置,避免模型 API 版本硬编码
6、优化管理页模型信息复制交互,提升剪贴板操作兼容性
[2026-07-29] v0.14.1-preview6 Dependency update from Senparc.Ncf.AreaBase to 0.22.0-preview3
[2026-07-31] v0.15.0-preview7 完善 AIKernel 管理页面多语言并升级 AI 基础依赖
1、补齐 AIKernel、AIVector 与 Dashboard 页面和脚本的多语言资源
2、升级 Senparc.AI 0.27.4、Kernel 0.29.1、Agents 0.7.3 与 AgentKernel 0.1.11
3、升级 Senparc.CO2NET.WebApi 2.1.9-preview 以适配 CO2NET 4.2.0
[2026-08-04] v0.15.1-preview8 Dependency updates from upstream projects
1、Dependency update from Senparc.Ncf.AreaBase to 0.23.1-preview5
2、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.5-preview5
3、Dependency update from Senparc.Ncf.XncfBase to 0.24.0-preview5
[2026-08-08] v0.15.2-preview9 Dependency updates from upstream projects
1、Dependency update from Senparc.Ncf.AreaBase to 0.23.2-preview6
2、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.6-preview6
3、Dependency update from Senparc.Ncf.XncfBase to 0.24.1-preview6
[2026-08-13] v0.15.3-preview10 Dependency update from Senparc.Ncf.AreaBase to 0.23.3-preview7; Senparc.Ncf.DatabasePlant to 0.21.7-preview7; Senparc.Ncf.XncfBase to 0.25.0-preview7
[2026-08-13] v0.15.3-preview11 保留 AIModel API Version 的兼容默认值
1、当 NeuCharAI / AzureOpenAI 模型未设置 ApiVersion 时,保留 2022-12-01 默认值而不写入 null
2、为 AgentKernel 与历史模型配置提供一致的 Azure-compatible API Version 语义
[2026-08-14] v0.15.3-preview12 修复 AIModel 指定模型测试的配置穿透
1、RunModelsync 使用调用方传入的 SenparcAiSetting 创建 AgentKernel,不再误用系统默认模型
2、避免默认模型成功被误判为数据库目标模型可用
3、统一指定模型在 NeuCharAI 与 AzureOpenAI 初始化时的兼容 API Version 默认值,并保证 RunModelsync 使用传入模型配置
[2026-08-17] v0.15.4 修复 Ollama 模型配置缺少 ModelName 的问题
1、BuildSenparcAiSetting 在 Ollama 场景写入 ModelName,保证指定模型测试与调用使用正确模型名
2、Ollama 模型配置写入 ModelName,保证指定模型调用使用正确模型名称
[2026-08-29] v0.15.5 Dependency updates from Senparc.Ncf.DatabasePlant to 0.21.10; Dependency update from Senparc.Ncf.XncfBase to 0.26.1
1、Dependency update from Senparc.Ncf.DatabasePlant to 0.21.10
2、Dependency update from Senparc.Ncf.XncfBase to 0.26.1
[2026-09-15] v0.16.0 新增 AI Token 用量监控与模型选择能力
1、新增 Token 用量记录、进度聚合、按模型与日期统计及后台监控页面
2、增加 AIModel 与 AIVector 选择列表接口,完善模型映射和多数据库迁移
3、适配 Senparc.AI AgentKernel 与 Microsoft Agents AI Harness 依赖版本
[2026-09-16] v0.16.1 适配 Senparc.NeuChar.App 1.6.0 依赖
1、升级 Senparc.NeuChar.App 至 1.6.0,保持 AI 模块与宿主应用的兼容
[2026-09-17] v0.16.2 适配共享 AgentKernel 预览依赖版本
1、同步 Senparc.AI.AgentKernel 至 0.1.14-preview5
2、保持 AIKernel 模块与共享模型调用依赖兼容
[2026-10-05] v0.16.3 Merge remote-tracking branch 'origin/Developer-MAF-V3' into Developer-MAF-V3-Spark
1、Updated Senparc.Xncf.AIKernel project behavior and integration for the latest feature and reliability improvements.
2、chore: update package versions and dependencies across multiple projects