TJC.Cyclops.AIAgent 2026.6.11.2

dotnet add package TJC.Cyclops.AIAgent --version 2026.6.11.2
                    
NuGet\Install-Package TJC.Cyclops.AIAgent -Version 2026.6.11.2
                    
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="TJC.Cyclops.AIAgent" Version="2026.6.11.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TJC.Cyclops.AIAgent" Version="2026.6.11.2" />
                    
Directory.Packages.props
<PackageReference Include="TJC.Cyclops.AIAgent" />
                    
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 TJC.Cyclops.AIAgent --version 2026.6.11.2
                    
#r "nuget: TJC.Cyclops.AIAgent, 2026.6.11.2"
                    
#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 TJC.Cyclops.AIAgent@2026.6.11.2
                    
#: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=TJC.Cyclops.AIAgent&version=2026.6.11.2
                    
Install as a Cake Addin
#tool nuget:?package=TJC.Cyclops.AIAgent&version=2026.6.11.2
                    
Install as a Cake Tool

Cyclops.AIAgent

🎉 释放 AI 潜能的强大框架 🎉

Cyclops.AIAgent 是一个功能丰富、高度可扩展的 AI 代理框架,为您提供与各种 AI 模型交互的能力,支持技能系统、工具调用和会话管理,让您的应用轻松集成先进的 AI 能力。

🌟 核心特性

  • 多模型支持:兼容 OpenAI、Azure OpenAI、Claude、Gemini、DeepSeek、Doubao、ERNIE、GLM、HunYuan、Kimi、MiMo、MiniMax、Qwen 等多种主流 AI 模型
  • 强大的技能系统:封装复杂任务,支持自动化执行和技能规划
  • 丰富的工具生态:内置文件系统工具、Web 抓取工具、命令执行工具等,可无限扩展
  • 智能会话管理:支持聊天历史记录、会话持久化和状态管理
  • 灵活的中间件系统:可自定义执行流程,实现个性化需求
  • 安全的工具执行:内置工具执行审批机制,保障系统安全
  • 流式响应支持:提供实时的 AI 响应体验

🚀 快速开始

使用依赖注入初始化 Cyclops.AIAgent:

using Cyclops.AIAgent.Abstractions;
using Cyclops.AIAgent.Providers.Kimi.DependencyInjection;

// 获取 Kimi 模型提供者
IChatModelProvider chatModelProvider = ServiceProviderUtil.GetRequiredServiceForOnce<IChatModelProvider>((services) =>
{
    services.AddKimiProvider(options =>
    {
        options.ApiKey = "your-kimi-api-key";
        options.BaseUrl = "https://api.moonshot.cn/v1/";
        options.RequestTimeout = TimeSpan.FromMinutes(2);
    });
});

// 构造聊天请求
var request = new ChatRequest
{
    ModelId = "kimi-k2.5",
    Messages = [
        ChatMessage.System("你是 Kimi,由 Moonshot AI 提供的人工智能助手。"),
        ChatMessage.User("请写一个 C# 方法来计算斐波那契数列的第 n 项")
    ],
    Options = new ChatOptions
    {
        Temperature = 1.0f,
        MaxTokens = 1000
    }
};

// 发送消息
var response = await chatModelProvider.CompleteAsync(request);
Console.WriteLine(response.Message?.TextContent);

🛠️ 工具生态

框架提供了丰富的内置工具,满足各种场景需求:

文件系统工具

  • list_directory:列出目录内容
  • search_files:搜索文件
  • read_file:读取文件内容
  • read_files_batch:批量读取文件
  • write_file:写入文件内容
  • create_directory:创建目录
  • move_file:移动文件
  • patch_file:修改文件内容
  • delete_file:删除文件
  • delete_directory:删除目录

网络工具

  • web_fetch:获取网页内容

系统工具

  • run_local_command:执行本地命令

🎯 技能系统

技能是复杂任务的封装,通过技能注册表管理,支持:

  • 技能规划和执行
  • 技能间的协作
  • 自定义技能的开发和注册

🔧 配置与扩展

通过依赖注入容器配置各种选项:

  • 模型提供者配置
  • 工具执行策略
  • 会话存储方式
  • 中间件注册

📦 安装

dotnet add package Cyclops.AIAgent

📖 使用指南

以下示例均使用 Kimi 提供者:

基本聊天

using Cyclops.AIAgent.Abstractions;
using Cyclops.AIAgent.Providers.Kimi.DependencyInjection;

// 获取 Kimi 模型提供者
IChatModelProvider chatModelProvider = ServiceProviderUtil.GetRequiredServiceForOnce<IChatModelProvider>((services) =>
{
    services.AddKimiProvider(options =>
    {
        options.ApiKey = "your-kimi-api-key";
        options.BaseUrl = "https://api.moonshot.cn/v1/";
        options.RequestTimeout = TimeSpan.FromMinutes(2);
    });
});

// 构造聊天请求
var request = new ChatRequest
{
    ModelId = "kimi-k2.5",
    Messages = [
        ChatMessage.System("你是 Kimi,由 Moonshot AI 提供的人工智能助手。"),
        ChatMessage.User("你好,能帮我解释什么是人工智能吗?")
    ],
    Options = new ChatOptions
    {
        Temperature = 1.0f,
        MaxTokens = 1000
    }
};

// 发送消息
var response = await chatModelProvider.CompleteAsync(request);
Console.WriteLine(response.Message?.TextContent);

流式响应

using Cyclops.AIAgent.Abstractions;
using Cyclops.AIAgent.Providers.Kimi.DependencyInjection;
using System.Text;

// 获取 Kimi 模型提供者
IChatModelProvider chatModelProvider = ServiceProviderUtil.GetRequiredServiceForOnce<IChatModelProvider>((services) =>
{
    services.AddKimiProvider(options =>
    {
        options.ApiKey = "your-kimi-api-key";
        options.BaseUrl = "https://api.moonshot.cn/v1/";
        options.RequestTimeout = TimeSpan.FromMinutes(2);
    });
});

// 构造聊天请求
var request = new ChatRequest
{
    ModelId = "kimi-k2.5",
    Messages = [
        ChatMessage.System("你是 Kimi,由 Moonshot AI 提供的人工智能助手。"),
        ChatMessage.User("请简单解释什么是斐波那契数列")
    ],
    Options = new ChatOptions
    {
        Temperature = 1.0f,
        MaxTokens = 500
    }
};

// 执行流式请求
var responseBuilder = new StringBuilder();

await foreach (var update in chatModelProvider.StreamAsync(request))
{
    if (update is TextDeltaUpdate textDelta)
    {
        responseBuilder.Append(textDelta.Delta);
        Console.Write(textDelta.Delta);
    }
}

Console.WriteLine("\n完整响应:");
Console.WriteLine(responseBuilder.ToString());

会话管理

using Cyclops.AIAgent.Abstractions;
using Cyclops.AIAgent.Providers.Kimi.DependencyInjection;

// 获取 Kimi 模型提供者
IChatModelProvider chatModelProvider = ServiceProviderUtil.GetRequiredServiceForOnce<IChatModelProvider>((services) =>
{
    services.AddKimiProvider(options =>
    {
        options.ApiKey = "your-kimi-api-key";
        options.BaseUrl = "https://api.moonshot.cn/v1/";
        options.RequestTimeout = TimeSpan.FromMinutes(2);
    });
});

// 构造聊天请求
var request = new ChatRequest
{
    ModelId = "kimi-k2.5",
    Messages = [
        ChatMessage.System("你是 Kimi,由 Moonshot AI 提供的人工智能助手。"),
        ChatMessage.User("你好")
    ]
};

// 发送消息
var response = await chatModelProvider.CompleteAsync(request);

// 继续对话,添加历史消息
request.Messages.Add(ChatMessage.Assistant(response.Message?.TextContent ?? ""));
request.Messages.Add(ChatMessage.User("再详细介绍一下"));

var followUpResponse = await chatModelProvider.CompleteAsync(request);
Console.WriteLine(followUpResponse.Message?.TextContent);

🤝 贡献

我们欢迎社区贡献!如果您有任何想法或建议,欢迎提交 Issue 或 Pull Request。

📄 许可证

MIT License


Cyclops.AIAgent - 让 AI 能力触手可及,为您的应用注入智能灵魂!✨

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
2026.6.11.2 80 6/11/2026
2026.6.11.1 76 6/11/2026
2026.6.9.4 85 6/9/2026
2026.6.9.3 88 6/9/2026
2026.6.9.2 89 6/9/2026
2026.6.9.1 90 6/9/2026
2026.6.8.3 93 6/8/2026
2026.6.8.2 92 6/8/2026
2026.6.8.1 87 6/8/2026
2026.6.5.1 97 6/5/2026
2026.5.18.1 97 5/18/2026
2026.5.11.1 97 5/11/2026
2026.5.7.2 92 5/7/2026
2026.5.7.1 92 5/7/2026
2026.4.29.2 89 4/29/2026
2026.4.29.1 106 4/29/2026
2026.4.27.1 95 4/27/2026
2026.4.24.2 99 4/24/2026
2026.4.24.1 99 4/24/2026
2026.4.14.2 107 4/14/2026
Loading failed

Cyclops.AIAgent 是一个 AI 代理框架,提供了与各种 AI 模型交互的能力,支持技能系统、工具调用和会话管理。