Skip to content

Commit e2c8e44

Browse files
authored
Merge branch 'SciSharp:master' into master
2 parents 022c050 + 9798426 commit e2c8e44

File tree

16 files changed

+630
-312
lines changed

16 files changed

+630
-312
lines changed

src/Plugins/BotSharp.Plugin.AzureOpenAI/Providers/Chat/ChatCompletionProvider.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,6 @@ public async Task<RoleDialogModel> GetChatCompletions(Agent agent, List<RoleDial
6767
responseMessage.FunctionName = responseMessage.FunctionName.Split('.').Last();
6868
}
6969
}
70-
//else if (reason == ChatFinishReason.ToolCalls)
71-
//{
72-
// var toolCall = value.ToolCalls.FirstOrDefault();
73-
// responseMessage = new RoleDialogModel(AgentRole.Function, text)
74-
// {
75-
// CurrentAgentId = agent.Id,
76-
// MessageId = conversations.LastOrDefault()?.MessageId ?? string.Empty,
77-
// FunctionName = toolCall?.FunctionName,
78-
// FunctionArgs = toolCall?.FunctionArguments
79-
// };
80-
//}
8170
else
8271
{
8372
responseMessage = new RoleDialogModel(AgentRole.Assistant, text)
@@ -281,13 +270,6 @@ public async Task<bool> GetChatCompletionsStreamingAsync(Agent agent, List<RoleD
281270
{
282271
if (message.Role == AgentRole.Function)
283272
{
284-
//messages.Add(new AssistantChatMessage(string.Empty)
285-
//{
286-
// FunctionCall = new ChatFunctionCall(message.FunctionName, message.FunctionArgs ?? string.Empty)
287-
//});
288-
289-
//messages.Add(new FunctionChatMessage(message.FunctionName, message.Content));
290-
291273
messages.Add(new AssistantChatMessage(new List<ChatToolCall>
292274
{
293275
ChatToolCall.CreateFunctionToolCall(message.FunctionName, message.FunctionName, BinaryData.FromString(message.FunctionArgs ?? string.Empty))

src/Plugins/BotSharp.Plugin.ExcelHandler/BotSharp.Plugin.ExcelHandler.csproj

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,24 @@
1313
</ItemGroup>
1414

1515
<ItemGroup>
16-
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.8" />
17-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
18-
<PackageReference Include="NPOI" Version="2.7.1" />
16+
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\handle_excel_request.json" />
17+
<None Remove="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\handle_excel_request.fn.liquid" />
1918
</ItemGroup>
2019

2120
<ItemGroup>
22-
<Folder Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\" />
23-
<Folder Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\" />
21+
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\functions\handle_excel_request.json">
22+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
23+
</Content>
24+
<Content Include="data\agents\6745151e-6d46-4a02-8de4-1c4f21c7da95\templates\handle_excel_request.fn.liquid">
25+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
26+
</Content>
27+
</ItemGroup>
28+
29+
<ItemGroup>
30+
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.8" />
31+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.8" />
32+
<PackageReference Include="MySql.Data" Version="9.0.0" />
33+
<PackageReference Include="NPOI" Version="2.7.1" />
2434
</ItemGroup>
2535

2636
<ItemGroup>

src/Plugins/BotSharp.Plugin.ExcelHandler/Enums/UtilityName.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
using System.Threading.Tasks;
6-
71
namespace BotSharp.Plugin.ExcelHandler.Enums;
82

93
public class UtilityName

src/Plugins/BotSharp.Plugin.ExcelHandler/ExcelHandlerPlugin.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
using System.Threading.Tasks;
66
using BotSharp.Abstraction.Plugins;
77
using BotSharp.Abstraction.Settings;
8-
using BotSharp.Plugin.ExcelHandler.Helpers;
8+
using BotSharp.Plugin.ExcelHandler.Helpers.MySql;
9+
using BotSharp.Plugin.ExcelHandler.Helpers.Sqlite;
910
using BotSharp.Plugin.ExcelHandler.Hooks;
11+
using BotSharp.Plugin.ExcelHandler.Services;
1012
using BotSharp.Plugin.ExcelHandler.Settings;
1113
using Microsoft.Extensions.Configuration;
1214

@@ -17,6 +19,7 @@ public class ExcelHandlerPlugin : IBotSharpPlugin
1719
public string Id => "c56a8e29-b16f-4d75-8766-8309342130cb";
1820
public string Name => "Excel Handler";
1921
public string Description => "Load data from excel file and transform it into a list of JSON format.";
22+
public string IconUrl => "https://w7.pngwing.com/pngs/162/301/png-transparent-microsoft-excel-logo-thumbnail.png";
2023

2124
public void RegisterDI(IServiceCollection services, IConfiguration config)
2225
{
@@ -28,6 +31,9 @@ public void RegisterDI(IServiceCollection services, IConfiguration config)
2831

2932
services.AddScoped<IAgentUtilityHook, ExcelHandlerUtilityHook>();
3033
services.AddScoped<IAgentHook, ExcelHandlerHook>();
31-
services.AddScoped<IDbHelpers, DbHelpers>();
34+
services.AddScoped<ISqliteDbHelpers, SqliteDbHelpers>();
35+
services.AddScoped<IMySqlDbHelper, MySqlDbHelpers>();
36+
services.AddScoped<ISqliteService, SqliteService>();
37+
services.AddScoped<IMySqlService, MySqlService>();
3238
}
3339
}

0 commit comments

Comments
 (0)