Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Senparc 全家桶的 AI 扩展包,目前主要集中于 LLM(大语言模型
|--------|--------|--------|
| Senparc.AI | 为所有标准接口和基础功能的基础模块 | [![Senparc.AI](https://img.shields.io/nuget/v/Senparc.AI.svg)](https://www.nuget.org/packages/Senparc.AI/) |
| Senparc.AI.Kernel | 为基于 Senparc.AI 标准,使用 [SemanticKernel](https://github.com/microsoft/semantic-kernel) 实现的接口调用,可以实现即插即用。| [![Senparc.AI.Kernel](https://img.shields.io/nuget/v/Senparc.AI.Kernel.svg)](https://www.nuget.org/packages/Senparc.AI.Kernel/) |
| Senparc.AI.Agents | 为基于 Senparc.AI 标准,使用 [AutoGen](https://github.com/microsoft/autogen) 实现的 Agent 集成扩展模块。| [![Senparc.AI.Agents](https://img.shields.io/nuget/v/Senparc.AI.Agents.svg)](https://www.nuget.org/packages/Senparc.AI.Agents/) |
`Senparc.AI.PromptRange`<br>([独立项目](https://github.com/Senparc/Senparc.AI.PromptRange)) | 为基于 Senparc.AI 标准,为“PromptRange(提示词靶场)”生态提供底层标准支持的底层库。目前已经由 [Senparc.Xncf.PromptRange](https://github.com/NeuCharFramework/NcfPackageSources/tree/master/src/Extensions/Senparc.Xncf.PromptRange) 实现,可用于开发基于 PromptRange 的扩展应用,兼容 Web、桌面、手机等系统(支持 .NET 6.0 及以上框架)。[NeuCharFramework(NCF)](https://github.com/orgs/NeuCharFramework) 框架已经默认集成 [Senparc.Xncf.PromptRange](https://github.com/NeuCharFramework/NcfPackageSources/tree/master/src/Extensions/Senparc.Xncf.PromptRange),可无需修改任何代码,直接使用。([什么是 PromptRange?](https://github.com/Senparc/Senparc.AI.PromptRange/wiki/What's-PromptRange%3F)) | |

## 开发过程
Expand Down Expand Up @@ -99,6 +100,7 @@ var aiResult = await iWantToRun.RunAsync(aiRequest);
文件夹 | 说明
------|--------
Samples/Senparc.AI.Samples.Consoles | 命令行
Samples/Senparc.AI.Samples.Agents | Agent(智能体)测试,已集成 AutoGen

## 命令示例行使用说明

Expand Down
10 changes: 9 additions & 1 deletion Samples/Senaprc.AI.Samples.Agents/AgentKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Text;
using System.Threading.Tasks;
using AutoGen.Core;
using Senparc.CO2NET.Trace;

namespace Senaprc.AI.Agents
{
Expand Down Expand Up @@ -33,7 +34,14 @@ public static class AgentKeys

if (key != null)
{
await Senparc.Weixin.Work.AdvancedAPIs.Webhook.WebhookApi.SendTextAsync(key, message);
try
{
await Senparc.Weixin.Work.AdvancedAPIs.Webhook.WebhookApi.SendTextAsync(key, message);
}
catch (Exception ex)
{
SenparcTrace.BaseExceptionLog(ex);
}
}
};
}
Expand Down
80 changes: 42 additions & 38 deletions Samples/Senaprc.AI.Samples.Agents/Senaprc.AI.Samples.Agents.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>SKEXP0050;</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="bak\**" />
<EmbeddedResource Remove="bak\**" />
<None Remove="bak\**" />
</ItemGroup>

<ItemGroup>
<None Remove="appsettings.Development.json" />
<None Remove="appsettings.json" />
</ItemGroup>

<ItemGroup>
<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoGen" Version="0.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Web" Version="1.11.1-alpha" />
<PackageReference Include="Senparc.Weixin.Work" Version="3.21.1" />
<PackageReference Include="Senparc.Weixin.Work.Middleware" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Senparc.AI.Agents\Senparc.AI.Agents.csproj" />
<ProjectReference Include="..\..\src\Senparc.AI.Kernel\Senparc.AI.Kernel.csproj" />
<ProjectReference Include="..\..\src\Senparc.AI\Senparc.AI.csproj" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<NoWarn>SKEXP0050;</NoWarn>
</PropertyGroup>

<ItemGroup>
<Compile Remove="bak\**" />
<EmbeddedResource Remove="bak\**" />
<None Remove="bak\**" />
</ItemGroup>

<ItemGroup>
<None Remove="appsettings.Development.json" />
<None Remove="appsettings.json" />
</ItemGroup>

<ItemGroup>
<Content Include="appsettings.Development.json" >
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

<Content Include="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<PackageReference Include="AutoGen" Version="0.0.13" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.SemanticKernel.Plugins.Web" Version="1.11.1-alpha" />
<PackageReference Include="Senparc.Weixin.Work" Version="3.21.1" />
<PackageReference Include="Senparc.Weixin.Work.Middleware" Version="1.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Senparc.AI.Agents\Senparc.AI.Agents.csproj" />
<ProjectReference Include="..\..\src\Senparc.AI.Kernel\Senparc.AI.Kernel.csproj" />
<ProjectReference Include="..\..\src\Senparc.AI\Senparc.AI.csproj" />
</ItemGroup>

</Project>
3 changes: 1 addition & 2 deletions src/Senparc.AI.Agents/Senparc.AI.Agents.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<RootNamespace>Senparc.AI.Agents</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<Description>
Senparc.AI 核心模块,目前为快速迭代,和 Senaprc.Weixin.AI 一起维护,V2.0 后期将独立项目
https://github.com/Senparc/Senaprc.Weixin.AI
Senparc.AI.Agents - AI Agents(智能体),支持 AutoGen,可配置 Agent 进行协作
</Description>
<Copyright>Senparc Copyright © 2004~2024</Copyright>
<PackageTags>
Expand Down
3 changes: 1 addition & 2 deletions src/Senparc.AI.Kernel/Senparc.AI.Kernel.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<RootNamespace>Senparc.AI.Kernel</RootNamespace>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<Description>
Senparc.AI 核心模块,目前为快速迭代,和 Senaprc.Weixin.AI 一起维护,V2.0 后期将独立项目
https://github.com/Senparc/Senaprc.Weixin.AI
Senparc.AI 核心模块,支持 Semantic Kernel,提供一系列 Senparc.AI 产品基础接口实现
</Description>
<Copyright>Senparc Copyright © 2004~2024</Copyright>
<PackageTags>
Expand Down
1 change: 0 additions & 1 deletion src/Senparc.AI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ Global
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Release|Any CPU.Build.0 = Release|Any CPU
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Test|Any CPU.ActiveCfg = Debug|Any CPU
{2802CC1C-39EF-4C11-8463-7934F7BD0E03}.Test|Any CPU.Build.0 = Debug|Any CPU
{60F51E40-9AA2-490C-9436-C0BB756D8BEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
Expand Down