Skip to content

Commit 3e8e6f9

Browse files
committed
Merge branch 'semantic-convention' of https://github.com/Ai4c-AI/BotSharp into langfuse
2 parents c4965c0 + 5fe6e6b commit 3e8e6f9

File tree

240 files changed

+5893
-2597
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+5893
-2597
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<TargetFramework>net8.0</TargetFramework>
44
<LangVersion>12.0</LangVersion>
5-
<BotSharpVersion>5.1.0</BotSharpVersion>
5+
<BotSharpVersion>5.2.0</BotSharpVersion>
66
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
77
<GenerateDocumentationFile>false</GenerateDocumentationFile>
88
</PropertyGroup>

Directory.Packages.props

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,27 @@
1010
<PackageVersion Include="DeviceId.Mac" Version="6.9.0" />
1111
<PackageVersion Include="DeviceId.Windows" Version="6.9.0" />
1212
<PackageVersion Include="DeviceId.Windows.Wmi" Version="6.9.0" />
13+
<PackageVersion Include="CsvHelper" Version="33.1.0" />
14+
<PackageVersion Include="FuzzySharp" Version="2.0.2" />
1315
<PackageVersion Include="EntityFramework" Version="6.4.4" />
14-
<PackageVersion Include="Google_GenerativeAI" Version="3.3.0" />
15-
<PackageVersion Include="Google_GenerativeAI.Live" Version="3.3.0" />
16-
<PackageVersion Include="LLMSharp.Google.Palm" Version="1.0.2" />
16+
<PackageVersion Include="Google_GenerativeAI" Version="3.4.1" />
17+
<PackageVersion Include="Google_GenerativeAI.Live" Version="3.4.1" />
1718
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="$(AspNetCoreVersion)" />
1819
<PackageVersion Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
19-
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
20+
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.0" />
2021
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
21-
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
22+
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0" />
2223
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
2324
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.3" />
24-
<PackageVersion Include="Microsoft.Extensions.Logging" Version="9.0.0" />
25+
<PackageVersion Include="Microsoft.Extensions.Logging" Version="10.0.0" />
2526
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="8.0.1" />
2627
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
28+
<PackageVersion Include="SharpFuzz" Version="2.2.0" />
2729
<PackageVersion Include="SharpHook" Version="5.3.9" />
28-
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.11" />
30+
<PackageVersion Include="SixLabors.ImageSharp" Version="3.1.12" />
2931
<PackageVersion Include="System.ClientModel" Version="1.3.0" />
3032
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
31-
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.0.0" />
33+
<PackageVersion Include="System.IdentityModel.Tokens.Jwt" Version="8.14.0" />
3234
<PackageVersion Include="System.Memory.Data" Version="8.0.0" />
3335
<PackageVersion Include="System.Text.Json" Version="9.0.11" />
3436
<PackageVersion Include="System.Reactive" Version="6.0.1" />
@@ -43,59 +45,59 @@
4345
<PackageVersion Include="Nanoid" Version="3.1.0" />
4446
<PackageVersion Include="Swashbuckle.AspNetCore" Version="8.1.2" />
4547
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="8.0.1" />
46-
<PackageVersion Include="Anthropic.SDK" Version="5.5.0" />
48+
<PackageVersion Include="Anthropic.SDK" Version="5.8.0" />
4749
<PackageVersion Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
4850
<PackageVersion Include="NAudio" Version="2.2.1" />
4951
<PackageVersion Include="NAudio.Core" Version="2.2.1" />
5052
<PackageVersion Include="Whisper.net" Version="1.8.1" />
5153
<PackageVersion Include="Whisper.net.Runtime" Version="1.8.1" />
5254
<PackageVersion Include="NCrontab" Version="3.3.3" />
53-
<PackageVersion Include="Azure.AI.OpenAI" Version="2.3.0-beta.2" />
54-
<PackageVersion Include="OpenAI" Version="2.5.0" />
55-
<PackageVersion Include="MailKit" Version="4.11.0" />
56-
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.8" />
57-
<PackageVersion Include="MySql.Data" Version="9.0.0" />
58-
<PackageVersion Include="NPOI" Version="2.7.1" />
55+
<PackageVersion Include="Azure.AI.OpenAI" Version="2.5.0-beta.1" />
56+
<PackageVersion Include="OpenAI" Version="2.6.0" />
57+
<PackageVersion Include="MailKit" Version="4.14.1" />
58+
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.0" />
59+
<PackageVersion Include="MySql.Data" Version="9.5.0" />
60+
<PackageVersion Include="NPOI" Version="2.7.5" />
5961
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Core" Version="2.3.0" />
6062
<PackageVersion Include="Refit" Version="8.0.0" />
6163
<PackageVersion Include="Refit.HttpClientFactory" Version="8.0.0" />
6264
<PackageVersion Include="Jint" Version="4.1.0" />
63-
<PackageVersion Include="PdfPig" Version="0.1.8" />
65+
<PackageVersion Include="PdfPig" Version="0.1.11" />
6466
<PackageVersion Include="TensorFlow.Keras" Version="0.15.0" />
65-
<PackageVersion Include="LangChain.Providers.Google.VertexAI" Version="0.15.3-dev.58" />
66-
<PackageVersion Include="LLamaSharp" Version="0.21.0" />
67+
<PackageVersion Include="LangChain.Providers.Google.VertexAI" Version="0.17.1-dev.48" />
68+
<PackageVersion Include="LLamaSharp" Version="0.25.0" />
6769
<PackageVersion Include="FaissMask" Version="0.4.2" />
6870
<PackageVersion Include="FastText.NetWrapper" Version="1.3.1" />
69-
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="9.10.2" />
70-
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.11" />
71-
<PackageVersion Include="MongoDB.Driver" Version="3.1.0" />
71+
<PackageVersion Include="Microsoft.Extensions.AI.Abstractions" Version="10.0.0" />
72+
<PackageVersion Include="System.Text.Encodings.Web" Version="10.0.0" />
73+
<PackageVersion Include="MongoDB.Driver" Version="3.5.0" />
7274
<PackageVersion Include="Docnet.Core" Version="2.7.0-alpha.1" />
73-
<PackageVersion Include="Magick.NET-Q16-AnyCPU" Version="13.8.0" />
74-
<PackageVersion Include="Magick.NET.Core" Version="13.8.0" />
75-
<PackageVersion Include="OpenCvSharp4.runtime.win" Version="4.9.0.20240103" />
76-
<PackageVersion Include="Sdcb.PaddleInference" Version="2.5.0.1" />
77-
<PackageVersion Include="Sdcb.PaddleInference.runtime.win64.mkl" Version="2.5.1" />
78-
<PackageVersion Include="Sdcb.PaddleOCR" Version="2.7.0.1" />
75+
<PackageVersion Include="Magick.NET-Q16-AnyCPU" Version="14.9.1" />
76+
<PackageVersion Include="Magick.NET.Core" Version="14.9.1" />
77+
<PackageVersion Include="OpenCvSharp4.runtime.win" Version="4.11.0.20250507" />
78+
<PackageVersion Include="Sdcb.PaddleInference" Version="3.0.1" />
79+
<PackageVersion Include="Sdcb.PaddleInference.runtime.win64.mkl" Version="3.1.0.54" />
80+
<PackageVersion Include="Sdcb.PaddleOCR" Version="3.0.1" />
7981
<PackageVersion Include="Sdcb.PaddleOCR.Models.LocalV3" Version="2.7.0.1" />
80-
<PackageVersion Include="System.Drawing.Common" Version="8.0.14" />
82+
<PackageVersion Include="System.Drawing.Common" Version="10.0.0" />
8183
<PackageVersion Include="pythonnet" Version="3.0.5" />
82-
<PackageVersion Include="Qdrant.Client" Version="1.15.0" />
84+
<PackageVersion Include="Qdrant.Client" Version="1.15.1" />
8385
<PackageVersion Include="Selenium.WebDriver" Version="4.27.0" />
84-
<PackageVersion Include="HtmlAgilityPack" Version="1.12.0" />
85-
<PackageVersion Include="Microsoft.SemanticKernel.Abstractions" Version="1.16.0" />
86+
<PackageVersion Include="HtmlAgilityPack" Version="1.12.4" />
87+
<PackageVersion Include="Microsoft.SemanticKernel.Abstractions" Version="1.67.1" />
8688
<PackageVersion Include="Microsoft.SemanticKernel.Plugins.Memory" Version="1.16.0-alpha" />
87-
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
89+
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.13.22" />
8890
<PackageVersion Include="Sdcb.SparkDesk" Version="3.1.0" />
89-
<PackageVersion Include="MySqlConnector" Version="2.4.0" />
90-
<PackageVersion Include="Npgsql" Version="8.0.7" />
91+
<PackageVersion Include="MySqlConnector" Version="2.5.0" />
92+
<PackageVersion Include="Npgsql" Version="9.0.4" />
9193
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.39" />
9294
<PackageVersion Include="StackExchange.Redis" Version="2.7.33" />
9395
<PackageVersion Include="StrongGrid" Version="0.108.0" />
9496
<PackageVersion Include="Twilio.AspNet.Common" Version="8.1.1" />
9597
<PackageVersion Include="Twilio.AspNet.Core" Version="8.1.1" />
96-
<PackageVersion Include="Microsoft.Playwright" Version="1.51.0" />
97-
<PackageVersion Include="Senparc.Weixin.MP.Middleware" Version="1.2.1" />
98-
<PackageVersion Include="System.Threading.Channels" Version="8.0.0" />
98+
<PackageVersion Include="Microsoft.Playwright" Version="1.56.0" />
99+
<PackageVersion Include="Senparc.Weixin.MP.Middleware" Version="1.5.0" />
100+
<PackageVersion Include="System.Threading.Channels" Version="10.0.0" />
99101
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="8.0.8" />
100102
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
101103
<PackageVersion Include="Serilog.Extensions.Hosting" Version="8.0.0" />

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ BotSharp uses component design, the kernel is kept to a minimum, and business fu
115115
- BotSharp.Plugin.Dashboard
116116
- BotSharp.Plugin.RoutingSpeeder
117117
- BotSharp.Plugin.AudioHandler
118+
- BotSharp.Plugin.ChartHandler
118119
- BotSharp.Plugin.EmailHandler
120+
- BotSharp.Plugin.ExcelHandler
119121
- BotSharp.Plugin.FileHandler
122+
- BotSharp.Plugin.ImageHandler
120123
- BotSharp.Plugin.HttpHandler
121124
- BotSharp.Plugin.SqlDriver
122125
- BotSharp.Plugin.WebDriver
@@ -130,7 +133,7 @@ BotSharp uses component design, the kernel is kept to a minimum, and business fu
130133
- [x] MCP
131134
- [x] Realtime
132135
- [ ] Computer Use
133-
- [x] Browser Use
136+
- [ ] Browser Use
134137
- [x] Database Assistant
135138
- [x] Code Interpreter
136139
- [x] Conversation Management

src/BotSharp.AppHost/BotSharp.AppHost.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
2-
2+
3+
<Sdk Name="Aspire.AppHost.Sdk" Version="9.5.2" />
34
<PropertyGroup>
45
<OutputType>Exe</OutputType>
56
<TargetFramework>net8.0</TargetFramework>

src/Infrastructure/BotSharp.Abstraction/Agents/AgentHookBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public virtual bool OnAgentLoading(ref string id)
2929
return true;
3030
}
3131

32-
public virtual bool OnInstructionLoaded(string template, Dictionary<string, object> dict)
32+
public virtual bool OnInstructionLoaded(string template, IDictionary<string, object> dict)
3333
{
3434
dict["current_date"] = $"{DateTime.Now:MMM dd, yyyy}";
3535
dict["current_time"] = $"{DateTime.Now:hh:mm tt}";

src/Infrastructure/BotSharp.Abstraction/Agents/IAgentHook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public interface IAgentHook : IHookBase
1616
/// <returns></returns>
1717
bool OnAgentLoading(ref string id);
1818

19-
bool OnInstructionLoaded(string template, Dictionary<string, object> dict);
19+
bool OnInstructionLoaded(string template, IDictionary<string, object> dict);
2020

2121
bool OnFunctionsLoaded(List<FunctionDef> functions);
2222

src/Infrastructure/BotSharp.Abstraction/Agents/IAgentService.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using BotSharp.Abstraction.Agents.Options;
2+
using BotSharp.Abstraction.Coding.Models;
3+
using BotSharp.Abstraction.Coding.Options;
24
using BotSharp.Abstraction.Functions.Models;
35
using BotSharp.Abstraction.Plugins.Models;
46
using BotSharp.Abstraction.Repositories.Filters;
@@ -30,18 +32,18 @@ public interface IAgentService
3032
/// <returns></returns>
3133
Task InheritAgent(Agent agent);
3234

33-
string RenderInstruction(Agent agent, Dictionary<string, object>? renderData = null);
35+
string RenderInstruction(Agent agent, IDictionary<string, object>? renderData = null);
3436

35-
string RenderTemplate(Agent agent, string templateName, Dictionary<string, object>? renderData = null);
37+
string RenderTemplate(Agent agent, string templateName, IDictionary<string, object>? renderData = null);
3638

37-
bool RenderFunction(Agent agent, FunctionDef def, Dictionary<string, object>? renderData = null);
39+
bool RenderFunction(Agent agent, FunctionDef def, IDictionary<string, object>? renderData = null);
3840

39-
FunctionParametersDef? RenderFunctionProperty(Agent agent, FunctionDef def, Dictionary<string, object>? renderData = null);
41+
FunctionParametersDef? RenderFunctionProperty(Agent agent, FunctionDef def, IDictionary<string, object>? renderData = null);
4042

41-
(string, IEnumerable<FunctionDef>) PrepareInstructionAndFunctions(Agent agent, Dictionary<string, object>? renderData = null, StringComparer? comparer = null);
43+
(string, IEnumerable<FunctionDef>) PrepareInstructionAndFunctions(Agent agent, IDictionary<string, object>? renderData = null, StringComparer? comparer = null);
4244

43-
bool RenderVisibility(string? visibilityExpression, Dictionary<string, object> dict);
44-
Dictionary<string, object> CollectRenderData(Agent agent);
45+
bool RenderVisibility(string? visibilityExpression, IDictionary<string, object> dict);
46+
IDictionary<string, object> CollectRenderData(Agent agent);
4547

4648

4749
/// <summary>
@@ -51,7 +53,7 @@ public interface IAgentService
5153
/// <returns>Original agent information</returns>
5254
Task<Agent> GetAgent(string id);
5355

54-
Task<bool> DeleteAgent(string id);
56+
Task<bool> DeleteAgent(string id, AgentDeleteOptions? options = null);
5557
Task UpdateAgent(Agent agent, AgentField updateField);
5658

5759
/// <summary>
@@ -70,9 +72,15 @@ public interface IAgentService
7072
Task<List<AgentCodeScript>> GetAgentCodeScripts(string agentId, AgentCodeScriptFilter? filter = null)
7173
=> Task.FromResult(new List<AgentCodeScript>());
7274

73-
Task<string?> GetAgentCodeScript(string agentId, string scriptName, string scriptType = AgentCodeScriptType.Src)
74-
=> Task.FromResult(string.Empty);
75+
Task<AgentCodeScript?> GetAgentCodeScript(string agentId, string scriptName, string scriptType = AgentCodeScriptType.Src)
76+
=> Task.FromResult((AgentCodeScript?)null);
7577

7678
Task<bool> UpdateAgentCodeScripts(string agentId, List<AgentCodeScript> codeScripts, AgentCodeScriptUpdateOptions? options = null)
7779
=> Task.FromResult(false);
80+
81+
Task<bool> DeleteAgentCodeScripts(string agentId, List<AgentCodeScript>? codeScripts = null)
82+
=> Task.FromResult(false);
83+
84+
Task<CodeGenerationResult> GenerateCodeScript(string agentId, string text, CodeGenHandleOptions? options = null)
85+
=> Task.FromResult(new CodeGenerationResult());
7886
}

src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentCodeScript.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ public class AgentCodeScript : AgentCodeScriptBase
55
public string Id { get; set; }
66
public string AgentId { get; set; } = null!;
77

8+
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
9+
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
10+
811
public AgentCodeScript() : base()
912
{
1013
}
1114

1215
public override string ToString()
1316
{
14-
return $"{CodePath}";
17+
return base.ToString();
1518
}
1619
}
1720

@@ -26,4 +29,9 @@ public class AgentCodeScriptBase
2629
public string ScriptType { get; set; } = null!;
2730

2831
public string CodePath => $"{ScriptType}/{Name}";
32+
33+
public override string ToString()
34+
{
35+
return $"{CodePath}";
36+
}
2937
}

src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentLlmConfig.cs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,11 @@ public class AgentLlmConfig
4343
public string? ReasoningEffortLevel { get; set; }
4444

4545
/// <summary>
46-
/// Image generation config
46+
/// Image composition config
4747
/// </summary>
48-
[JsonPropertyName("image_generation")]
48+
[JsonPropertyName("image_composition")]
4949
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
50-
public LlmImageGenerationConfig? ImageGeneration { get; set; }
51-
52-
/// <summary>
53-
/// Image edit config
54-
/// </summary>
55-
[JsonPropertyName("image_edit")]
56-
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
57-
public LlmImageEditConfig? ImageEdit { get; set; }
50+
public LlmImageCompositionConfig? ImageComposition { get; set; }
5851

5952
/// <summary>
6053
/// Audio transcription config
@@ -71,12 +64,7 @@ public class AgentLlmConfig
7164
public LlmRealtimeConfig? Realtime { get; set; }
7265
}
7366

74-
75-
public class LlmImageGenerationConfig : LlmProviderModel
76-
{
77-
}
78-
79-
public class LlmImageEditConfig : LlmProviderModel
67+
public class LlmImageCompositionConfig : LlmProviderModel
8068
{
8169
}
8270

src/Infrastructure/BotSharp.Abstraction/Agents/Models/AgentRule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ namespace BotSharp.Abstraction.Agents.Models;
33
public class AgentRule
44
{
55
[JsonPropertyName("trigger_name")]
6-
public string TriggerName { get; set; }
6+
public string TriggerName { get; set; } = string.Empty;
77

88
[JsonPropertyName("disabled")]
99
public bool Disabled { get; set; }
1010

1111
[JsonPropertyName("criteria")]
12-
public string Criteria { get; set; }
12+
public string Criteria { get; set; } = string.Empty;
1313
}

0 commit comments

Comments
 (0)