Skip to content

Commit a8fa46e

Browse files
author
Jicheng Lu
committed
add deep seek
1 parent 7bae527 commit a8fa46e

File tree

15 files changed

+529
-12
lines changed

15 files changed

+529
-12
lines changed

BotSharp.sln

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.Crontab", "sr
125125
EndProject
126126
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Core.Rules", "src\Infrastructure\BotSharp.Core.Rules\BotSharp.Core.Rules.csproj", "{AFD64412-4D6A-452E-82A2-79E5D8842E29}"
127127
EndProject
128+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.DeepSeekAI", "src\Plugins\BotSharp.Plugin.DeepSeekAI\BotSharp.Plugin.DeepSeekAI.csproj", "{AF329442-B48E-4B48-A18A-1C869D1BA6F5}"
129+
EndProject
128130
Global
129131
GlobalSection(SolutionConfigurationPlatforms) = preSolution
130132
Debug|Any CPU = Debug|Any CPU
@@ -509,6 +511,14 @@ Global
509511
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|Any CPU.Build.0 = Release|Any CPU
510512
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|x64.ActiveCfg = Release|Any CPU
511513
{AFD64412-4D6A-452E-82A2-79E5D8842E29}.Release|x64.Build.0 = Release|Any CPU
514+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
515+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
516+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Debug|x64.ActiveCfg = Debug|Any CPU
517+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Debug|x64.Build.0 = Debug|Any CPU
518+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
519+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Release|Any CPU.Build.0 = Release|Any CPU
520+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Release|x64.ActiveCfg = Release|Any CPU
521+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5}.Release|x64.Build.0 = Release|Any CPU
512522
EndGlobalSection
513523
GlobalSection(SolutionProperties) = preSolution
514524
HideSolutionNode = FALSE
@@ -569,6 +579,7 @@ Global
569579
{7DA2DCD0-551B-432E-AA5C-22DDD3ED459B} = {D5293208-2BEF-42FC-A64C-5954F61720BA}
570580
{F812BAAE-5A7D-4DF7-8E71-70696B51C61F} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
571581
{AFD64412-4D6A-452E-82A2-79E5D8842E29} = {E29DC6C4-5E57-48C5-BCB0-6B8F84782749}
582+
{AF329442-B48E-4B48-A18A-1C869D1BA6F5} = {D5293208-2BEF-42FC-A64C-5954F61720BA}
572583
EndGlobalSection
573584
GlobalSection(ExtensibilityGlobals) = postSolution
574585
SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19}

src/Infrastructure/BotSharp.Abstraction/Statistics/Services/IBotSharpStatService.cs renamed to src/Infrastructure/BotSharp.Abstraction/Statistics/Services/IBotSharpStatsService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace BotSharp.Abstraction.Statistics.Services;
44

5-
public interface IBotSharpStatService
5+
public interface IBotSharpStatsService
66
{
77
bool UpdateLlmCost(BotSharpStats stats);
88
bool UpdateAgentCall(BotSharpStats stats);

src/Infrastructure/BotSharp.Core/Agents/AgentPlugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void RegisterDI(IServiceCollection services, IConfiguration config)
3333
services.AddScoped<ILlmProviderService, LlmProviderService>();
3434
services.AddScoped<IAgentService, AgentService>();
3535
services.AddScoped<IAgentHook, BasicAgentHook>();
36-
services.AddScoped<IBotSharpStatService, BotSharpStatService>();
36+
services.AddScoped<IBotSharpStatsService, BotSharpStatsService>();
3737

3838
services.AddScoped(provider =>
3939
{

src/Infrastructure/BotSharp.Core/Conversations/Services/TokenStatistics.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public void AddToken(TokenStatsModel stats, RoleDialogModel message)
5959
stat.SetState("llm_total_cost", total_cost, isNeedVersion: false, source: StateSource.Application);
6060

6161

62-
var globalStats = _services.GetRequiredService<IBotSharpStatService>();
62+
var globalStats = _services.GetRequiredService<IBotSharpStatsService>();
6363
var body = new BotSharpStats
6464
{
6565
Category = StatCategory.LlmCost,

src/Infrastructure/BotSharp.Core/Statistics/Services/BotSharpStatService.cs renamed to src/Infrastructure/BotSharp.Core/Statistics/Services/BotSharpStatsService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
namespace BotSharp.Core.Statistics.Services;
55

6-
public class BotSharpStatService : IBotSharpStatService
6+
public class BotSharpStatsService : IBotSharpStatsService
77
{
88
private readonly IServiceProvider _services;
9-
private readonly ILogger<BotSharpStatService> _logger;
9+
private readonly ILogger<BotSharpStatsService> _logger;
1010
private readonly StatisticsSettings _settings;
1111

1212
private const string GLOBAL_LLM_COST = "global-llm-cost";
1313
private const string GLOBAL_AGENT_CALL = "global-agent-call";
1414
private const int TIMEOUT_SECONDS = 5;
1515

16-
public BotSharpStatService(
16+
public BotSharpStatsService(
1717
IServiceProvider services,
18-
ILogger<BotSharpStatService> logger,
18+
ILogger<BotSharpStatsService> logger,
1919
StatisticsSettings settings)
2020
{
2121
_services = services;

src/Infrastructure/BotSharp.Logger/Hooks/GlobalStatsConversationHook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public override async Task OnPostbackMessageReceived(RoleDialogModel message, Po
2727
private void UpdateAgentCall(RoleDialogModel message)
2828
{
2929
// record agent call
30-
var globalStats = _services.GetRequiredService<IBotSharpStatService>();
30+
var globalStats = _services.GetRequiredService<IBotSharpStatsService>();
3131

3232
var body = new BotSharpStats
3333
{
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>$(TargetFramework)</TargetFramework>
5+
<Nullable>enable</Nullable>
6+
<LangVersion>$(LangVersion)</LangVersion>
7+
<VersionPrefix>$(BotSharpVersion)</VersionPrefix>
8+
<GeneratePackageOnBuild>$(GeneratePackageOnBuild)</GeneratePackageOnBuild>
9+
<GenerateDocumentationFile>$(GenerateDocumentationFile)</GenerateDocumentationFile>
10+
<OutputPath>$(SolutionDir)packages</OutputPath>
11+
</PropertyGroup>
12+
13+
<ItemGroup>
14+
<PackageReference Include="OpenAI" Version="2.1.0" />
15+
</ItemGroup>
16+
17+
<ItemGroup>
18+
<ProjectReference Include="..\..\Infrastructure\BotSharp.Abstraction\BotSharp.Abstraction.csproj" />
19+
</ItemGroup>
20+
21+
</Project>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using BotSharp.Abstraction.Plugins;
2+
using BotSharp.Plugin.DeepSeek.Providers.Text;
3+
using BotSharp.Plugin.DeepSeekAI.Providers.Chat;
4+
5+
namespace BotSharp.Plugin.DeepSeek;
6+
7+
public class DeepSeekAiPlugin : IBotSharpPlugin
8+
{
9+
public string Id => "1f0e73a5-bcaa-44e9-adde-e46cd94d244b";
10+
public string Name => "DeepSeek";
11+
public string Description => "DeepSeek AI";
12+
public string IconUrl => "https://cdn.deepseek.com/logo.png";
13+
public void RegisterDI(IServiceCollection services, IConfiguration config)
14+
{
15+
services.AddScoped<ITextCompletion, TextCompletionProvider>();
16+
services.AddScoped<IChatCompletion, ChatCompletionProvider>();
17+
}
18+
}

0 commit comments

Comments
 (0)