Netor.Cortana.Plugin.Abstractions
1.0.5
dotnet add package Netor.Cortana.Plugin.Abstractions --version 1.0.5
NuGet\Install-Package Netor.Cortana.Plugin.Abstractions -Version 1.0.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="Netor.Cortana.Plugin.Abstractions" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Netor.Cortana.Plugin.Abstractions" Version="1.0.5" />
<PackageReference Include="Netor.Cortana.Plugin.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 Netor.Cortana.Plugin.Abstractions --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Netor.Cortana.Plugin.Abstractions, 1.0.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 Netor.Cortana.Plugin.Abstractions@1.0.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=Netor.Cortana.Plugin.Abstractions&version=1.0.5
#tool nuget:?package=Netor.Cortana.Plugin.Abstractions&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Netor.Cortana.Plugin.Abstractions
Cortana 插件系统的抽象接口库,定义了插件开发的核心契约。所有插件(托管插件和原生插件)都基于此库定义的接口进行交互。
功能
IPlugin— 插件核心接口,声明 Id、名称、版本、工具列表、AI 指令等IPluginContext— 宿主向插件暴露的有限上下文,提供数据目录、日志、HttpClient 等基础设施
安装
dotnet add package Netor.Cortana.Plugin.Abstractions
核心接口
IPlugin
插件必须实现的主接口,宿主通过此接口加载和管理插件。
public interface IPlugin
{
string Id { get; }
string Name { get; }
Version Version { get; }
string Description { get; }
IReadOnlyList<string> Tags { get; }
IReadOnlyList<AITool> Tools { get; }
string? Instructions { get; }
Task InitializeAsync(IPluginContext context);
}
| 属性 | 说明 |
|---|---|
Id |
插件唯一标识 |
Name |
插件名称 |
Version |
插件版本 |
Description |
插件描述 |
Tags |
分类标签 |
Tools |
插件提供的 AI 工具列表(基于 Microsoft.Extensions.AI) |
Instructions |
AI 系统指令片段,告诉 AI 何时及如何使用这些工具 |
InitializeAsync |
插件初始化入口,宿主传入 IPluginContext |
IPluginContext
宿主向插件暴露的有限上下文,避免插件直接访问宿主内部。
public interface IPluginContext
{
string DataDirectory { get; }
string WorkspaceDirectory { get; }
ILoggerFactory LoggerFactory { get; }
IHttpClientFactory HttpClientFactory { get; }
int WsPort { get; }
}
| 属性 | 说明 |
|---|---|
DataDirectory |
插件专属的数据存储目录 |
WorkspaceDirectory |
当前工作区目录 |
LoggerFactory |
宿主提供的日志工厂 |
HttpClientFactory |
宿主提供的 HttpClientFactory |
WsPort |
WebSocket 服务器端口,供插件建立 WS 连接 |
依赖
Microsoft.Extensions.AI.Abstractions— AI 工具抽象(AITool)Microsoft.Extensions.Http—IHttpClientFactoryMicrosoft.Extensions.Logging.Abstractions—ILoggerFactory
要求
- .NET Standard 2.0+(兼容 .NET Framework 4.6.1+ 和 .NET Core 2.0+)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Microsoft.Extensions.AI.Abstractions (>= 10.4.1)
- Microsoft.Extensions.Http (>= 10.0.5)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.5)
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 | |
|---|---|---|---|
| 1.0.5 | 204 | 4/10/2026 |