AbpAgnoSharp 是一个用于对接 Agno AgentOS 服务的 ABP Framework 集成库。
-
完整的 Agno AgentOS API 支持
- Agent API - 代理管理
- Team API - 团队管理
- Workflow API - 工作流管理
- Knowledge API - 知识库管理
- Traces API - 追踪管理
- Memory API - 记忆管理
- Database API - 数据库管理
-
基于 WebApiClientCore 的 HTTP 客户端
-
自动认证处理
-
支持 JSON 序列化/反序列化(Snake Case)
-
依赖注入支持
dotnet add package AbpAgnoSharp或通过 Package Manager Console:
Install-Package AbpAgnoSharp在您的 ABP 项目中添加项目引用:
<ProjectReference Include="..\AbpAgnoSharp\AbpAgnoSharp.csproj" />在 appsettings.json 中配置 Agno 服务:
{
"AI": {
"Agno": {
"ApiKey": "your-api-key",
"BaseUrl": "http://localhost:7777",
"EnableLogging": false
}
}
}[DependsOn(typeof(AbpAgnoSharpModule))]
public class YourModule : AbpModule
{
// ...
}public class YourService : ITransientDependency
{
private readonly AgentClient _agentClient;
public YourService(AgentClient agentClient)
{
_agentClient = agentClient;
}
public async Task GetAgentsAsync()
{
var response = await _agentClient.GetAgents();
// 处理响应
}
}public class YourService : ITransientDependency
{
private readonly IAgentApi _agentApi;
public YourService(IAgentApi agentApi)
{
_agentApi = agentApi;
}
public async Task GetAgentsAsync()
{
var response = await _agentApi.GetAgents();
// 处理响应
}
}项目提供了以下客户端类:
AgentClient- 代理操作TeamClient- 团队操作WorkflowClient- 工作流操作KnowledgeClient- 知识库操作TracesClient- 追踪操作MemoryClient- 记忆操作DatabaseClient- 数据库操作
- Volo.Abp (10.0.1)
- WebApiClientCore (2.1.5)
- WebApiClientCore.Extensions.OAuths (2.1.5)
本项目采用 MIT 许可证。
欢迎提交 Issue 和 Pull Request!