Skip to content

Commit ee816cc

Browse files
authored
Merge branch 'master' into semantic-convention
2 parents 044cc2a + d1df7f7 commit ee816cc

File tree

247 files changed

+3651
-904
lines changed

Some content is hidden

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

247 files changed

+3651
-904
lines changed

BotSharp.sln

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.ExcelHandle
149149
EndProject
150150
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.GiteeAI", "src\Plugins\BotSharp.Plugin.GiteeAI\BotSharp.Plugin.GiteeAI.csproj", "{50B57066-3267-1D10-0F72-D2F5CC494F2C}"
151151
EndProject
152+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BotSharp.Plugin.ImageHandler", "src\Plugins\BotSharp.Plugin.ImageHandler\BotSharp.Plugin.ImageHandler.csproj", "{242F2D93-FCCE-4982-8075-F3052ECCA92C}"
153+
EndProject
152154
Global
153155
GlobalSection(SolutionConfigurationPlatforms) = preSolution
154156
Debug|Any CPU = Debug|Any CPU
@@ -629,6 +631,14 @@ Global
629631
{50B57066-3267-1D10-0F72-D2F5CC494F2C}.Release|Any CPU.Build.0 = Release|Any CPU
630632
{50B57066-3267-1D10-0F72-D2F5CC494F2C}.Release|x64.ActiveCfg = Release|Any CPU
631633
{50B57066-3267-1D10-0F72-D2F5CC494F2C}.Release|x64.Build.0 = Release|Any CPU
634+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
635+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Debug|Any CPU.Build.0 = Debug|Any CPU
636+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Debug|x64.ActiveCfg = Debug|Any CPU
637+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Debug|x64.Build.0 = Debug|Any CPU
638+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Release|Any CPU.ActiveCfg = Release|Any CPU
639+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Release|Any CPU.Build.0 = Release|Any CPU
640+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Release|x64.ActiveCfg = Release|Any CPU
641+
{242F2D93-FCCE-4982-8075-F3052ECCA92C}.Release|x64.Build.0 = Release|Any CPU
632642
EndGlobalSection
633643
GlobalSection(SolutionProperties) = preSolution
634644
HideSolutionNode = FALSE
@@ -701,6 +711,7 @@ Global
701711
{0428DEAA-E4FE-4259-A6D8-6EDD1A9D0702} = {51AFE054-AE99-497D-A593-69BAEFB5106F}
702712
{FC63C875-E880-D8BB-B8B5-978AB7B62983} = {51AFE054-AE99-497D-A593-69BAEFB5106F}
703713
{50B57066-3267-1D10-0F72-D2F5CC494F2C} = {D5293208-2BEF-42FC-A64C-5954F61720BA}
714+
{242F2D93-FCCE-4982-8075-F3052ECCA92C} = {51AFE054-AE99-497D-A593-69BAEFB5106F}
704715
EndGlobalSection
705716
GlobalSection(ExtensibilityGlobals) = postSolution
706717
SolutionGuid = {A9969D89-C98B-40A5-A12B-FC87E55B3A19}

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77
<ItemGroup>
88
<PackageVersion Include="EntityFramework" Version="6.4.4" />
9-
<PackageVersion Include="Google_GenerativeAI" Version="3.2.0" />
10-
<PackageVersion Include="Google_GenerativeAI.Live" Version="3.2.0" />
9+
<PackageVersion Include="Google_GenerativeAI" Version="3.3.0" />
10+
<PackageVersion Include="Google_GenerativeAI.Live" Version="3.3.0" />
1111
<PackageVersion Include="LLMSharp.Google.Palm" Version="1.0.2" />
1212
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="$(AspNetCoreVersion)" />
1313
<PackageVersion Include="Microsoft.AspNetCore.StaticFiles" Version="$(AspNetCoreVersion)" />
@@ -32,7 +32,7 @@
3232
<PackageVersion Include="Serilog.Sinks.File" Version="6.0.0" />
3333
<PackageVersion Include="Rougamo.Fody" Version="5.0.0" />
3434
<PackageVersion Include="Aspects.Cache" Version="2.0.4" />
35-
<PackageVersion Include="DistributedLock.Redis" Version="1.0.3" />
35+
<PackageVersion Include="DistributedLock.Redis" Version="1.1.0" />
3636
<PackageVersion Include="EntityFrameworkCore.BootKit" Version="8.9.0" />
3737
<PackageVersion Include="Fluid.Core" Version="2.11.1" />
3838
<PackageVersion Include="Nanoid" Version="3.1.0" />
@@ -46,7 +46,7 @@
4646
<PackageVersion Include="Whisper.net.Runtime" Version="1.8.1" />
4747
<PackageVersion Include="NCrontab" Version="3.3.3" />
4848
<PackageVersion Include="Azure.AI.OpenAI" Version="2.3.0-beta.2" />
49-
<PackageVersion Include="OpenAI" Version="2.4.0" />
49+
<PackageVersion Include="OpenAI" Version="2.5.0" />
5050
<PackageVersion Include="MailKit" Version="4.11.0" />
5151
<PackageVersion Include="Microsoft.Data.Sqlite" Version="8.0.8" />
5252
<PackageVersion Include="MySql.Data" Version="9.0.0" />
@@ -73,7 +73,7 @@
7373
<PackageVersion Include="Sdcb.PaddleOCR" Version="2.7.0.1" />
7474
<PackageVersion Include="Sdcb.PaddleOCR.Models.LocalV3" Version="2.7.0.1" />
7575
<PackageVersion Include="System.Drawing.Common" Version="8.0.14" />
76-
<PackageVersion Include="pythonnet" Version="3.0.4" />
76+
<PackageVersion Include="pythonnet" Version="3.0.5" />
7777
<PackageVersion Include="Qdrant.Client" Version="1.15.0" />
7878
<PackageVersion Include="Selenium.WebDriver" Version="4.27.0" />
7979
<PackageVersion Include="HtmlAgilityPack" Version="1.12.0" />
@@ -84,7 +84,7 @@
8484
<PackageVersion Include="MySqlConnector" Version="2.4.0" />
8585
<PackageVersion Include="Npgsql" Version="8.0.7" />
8686
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.39" />
87-
<PackageVersion Include="StackExchange.Redis" Version="2.7.27" />
87+
<PackageVersion Include="StackExchange.Redis" Version="2.7.33" />
8888
<PackageVersion Include="StrongGrid" Version="0.108.0" />
8989
<PackageVersion Include="Twilio.AspNet.Common" Version="8.1.1" />
9090
<PackageVersion Include="Twilio.AspNet.Core" Version="8.1.1" />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace BotSharp.Abstraction.Agents.Enums;
2+
3+
public static class AgentCodeScriptType
4+
{
5+
public const string Src = "src";
6+
public const string Test = "test";
7+
}

src/Infrastructure/BotSharp.Abstraction/Agents/Enums/AgentFuncVisMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BotSharp.Abstraction.Agents.Enums;
22

3-
public class AgentFuncVisMode
3+
public static class AgentFuncVisMode
44
{
55
public const string Manual = "manual";
66
public const string Auto = "auto";

src/Infrastructure/BotSharp.Abstraction/Agents/Enums/AgentRole.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BotSharp.Abstraction.Agents.Enums;
22

3-
public class AgentRole
3+
public static class AgentRole
44
{
55
public const string System = "system";
66
public const string Assistant = "assistant";

src/Infrastructure/BotSharp.Abstraction/Agents/Enums/AgentType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BotSharp.Abstraction.Agents.Enums;
22

3-
public class AgentType
3+
public static class AgentType
44
{
55
/// <summary>
66
/// Routing agent

src/Infrastructure/BotSharp.Abstraction/Agents/Enums/BuiltInAgentId.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BotSharp.Abstraction.Agents.Enums;
22

3-
public class BuiltInAgentId
3+
public static class BuiltInAgentId
44
{
55
/// <summary>
66
/// A routing agent can be used as a base router.
@@ -51,4 +51,14 @@ public class BuiltInAgentId
5151
/// Translates user-defined natural language rules into programmatic code
5252
/// </summary>
5353
public const string RulesInterpreter = "201e49a2-40b3-4ccd-b8cc-2476565a1b40";
54+
55+
/// <summary>
56+
/// Generate code script
57+
/// </summary>
58+
public const string AIProgrammer = "c2a2faf6-b8b5-47fe-807b-f4714cf25dd4";
59+
60+
/// <summary>
61+
/// Handle files
62+
/// </summary>
63+
public const string FileAssistant = "f1e09a73-9efe-46ce-ba02-b3aaf96d97e0";
5464
}

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using BotSharp.Abstraction.Agents.Options;
12
using BotSharp.Abstraction.Functions.Models;
23
using BotSharp.Abstraction.Plugins.Models;
34
using BotSharp.Abstraction.Repositories.Filters;
@@ -59,11 +60,19 @@ public interface IAgentService
5960
/// <param name="agent"></param>
6061
/// <returns></returns>
6162
Task<string> PatchAgentTemplate(Agent agent);
62-
Task<string> UpdateAgentFromFile(string id);
6363
string GetDataDir();
6464
string GetAgentDataDir(string agentId);
6565

6666
Task<List<UserAgent>> GetUserAgents(string userId);
6767

6868
PluginDef GetPlugin(string agentId);
69+
70+
Task<List<AgentCodeScript>> GetAgentCodeScripts(string agentId, AgentCodeScriptFilter? filter = null)
71+
=> Task.FromResult(new List<AgentCodeScript>());
72+
73+
Task<string?> GetAgentCodeScript(string agentId, string scriptName, string scriptType = AgentCodeScriptType.Src)
74+
=> Task.FromResult(string.Empty);
75+
76+
Task<bool> UpdateAgentCodeScripts(string agentId, List<AgentCodeScript> codeScripts, AgentCodeScriptUpdateOptions? options = null)
77+
=> Task.FromResult(false);
6978
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
namespace BotSharp.Abstraction.Agents.Models;
2+
3+
public class AgentCodeScript : AgentCodeScriptBase
4+
{
5+
public string Id { get; set; }
6+
public string AgentId { get; set; } = null!;
7+
8+
public AgentCodeScript() : base()
9+
{
10+
}
11+
12+
public override string ToString()
13+
{
14+
return $"{CodePath}";
15+
}
16+
}
17+
18+
public class AgentCodeScriptBase
19+
{
20+
public string Name { get; set; } = null!;
21+
public string Content { get; set; } = null!;
22+
23+
/// <summary>
24+
/// Code script type: src, test
25+
/// </summary>
26+
public string ScriptType { get; set; } = null!;
27+
28+
public string CodePath => $"{ScriptType}/{Name}";
29+
}

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,49 @@ public class AgentLlmConfig
4141
[JsonPropertyName("reasoning_effort_level")]
4242
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
4343
public string? ReasoningEffortLevel { get; set; }
44+
45+
/// <summary>
46+
/// Image generation config
47+
/// </summary>
48+
[JsonPropertyName("image_generation")]
49+
[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; }
58+
59+
/// <summary>
60+
/// Audio transcription config
61+
/// </summary>
62+
[JsonPropertyName("audio_transcription")]
63+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
64+
public LlmAudioTranscriptionConfig? AudioTranscription { get; set; }
65+
66+
/// <summary>
67+
/// Realtime config
68+
/// </summary>
69+
[JsonPropertyName("realtime")]
70+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
71+
public LlmRealtimeConfig? Realtime { get; set; }
72+
}
73+
74+
75+
public class LlmImageGenerationConfig : LlmProviderModel
76+
{
77+
}
78+
79+
public class LlmImageEditConfig : LlmProviderModel
80+
{
4481
}
82+
83+
public class LlmAudioTranscriptionConfig : LlmProviderModel
84+
{
85+
}
86+
87+
public class LlmRealtimeConfig : LlmProviderModel
88+
{
89+
}

0 commit comments

Comments
 (0)