Skip to content

Commit d9c5f5a

Browse files
author
hchen2020
committed
Enhance Agent Rounter mechanism
1 parent 9bbbede commit d9c5f5a

21 files changed

Lines changed: 51 additions & 437 deletions

‎src/Infrastructure/BotSharp.Abstraction/Conversations/IConversationStorage.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ namespace BotSharp.Abstraction.Conversations;
55
public interface IConversationStorage
66
{
77
void InitStorage(string conversationId);
8-
void Append(string conversationId, Agent agent, RoleDialogModel dialog);
8+
void Append(string conversationId, string agentId, RoleDialogModel dialog);
99
List<RoleDialogModel> GetDialogs(string conversationId);
1010
}

‎src/Infrastructure/BotSharp.Core/Agents/AgentController.cs‎

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎src/Infrastructure/BotSharp.Core/Agents/Services/AgentHookBase.cs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
using BotSharp.Abstraction.Agents.Models;
22
using BotSharp.Abstraction.Conversations.Models;
33
using Fluid;
4-
using Microsoft.AspNetCore.Mvc;
54

65
namespace BotSharp.Core.Agents.Services;
76

‎src/Infrastructure/BotSharp.Core/Agents/Services/AgentService.GetAgents.cs‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,11 @@ public async Task<Agent> GetAgent(string id)
4040
{
4141
profile.Samples = File.ReadAllText(samplesFile);
4242
}
43-
else
44-
{
45-
_logger.LogWarning($"Can't find samples file from {samplesFile}");
46-
}
47-
4843
var functionsFile = Path.Combine(dir, "functions.json");
4944
if (File.Exists(functionsFile))
5045
{
5146
profile.Functions = File.ReadAllText(functionsFile);
5247
}
53-
else
54-
{
55-
_logger.LogInformation($"Can't find functions file from {functionsFile}");
56-
}
5748

5849
return profile;
5950
}

‎src/Infrastructure/BotSharp.Core/Agents/ViewModels/AgentCreationModel.cs‎

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎src/Infrastructure/BotSharp.Core/Agents/ViewModels/AgentUpdateModel.cs‎

Lines changed: 0 additions & 46 deletions
This file was deleted.

‎src/Infrastructure/BotSharp.Core/Agents/ViewModels/AgentViewModel.cs‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎src/Infrastructure/BotSharp.Core/BotSharp.Core.csproj‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@
7777
<PackageReference Include="EntityFrameworkCore.BootKit" Version="6.2.1" />
7878
<PackageReference Include="Fluid.Core" Version="2.4.0" />
7979
<PackageReference Include="LLamaSharp" Version="0.4.2-preview" />
80-
<PackageReference Include="PdfPig" Version="0.1.8" />
8180
<PackageReference Include="TensorFlow.Keras" Version="0.11.2" />
82-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.2.5" />
8381
</ItemGroup>
8482

8583
<ItemGroup>

‎src/Infrastructure/BotSharp.Core/BotSharpServiceCollectionExtensions.cs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using BotSharp.Abstraction.Functions;
2+
using BotSharp.Core.Functions;
13
using Microsoft.AspNetCore.Builder;
24
using Microsoft.Extensions.Configuration;
35

@@ -35,6 +37,8 @@ public static IServiceCollection AddBotSharp(this IServiceCollection services, I
3537

3638
services.AddScoped<IAgentRouting, AgentRouter>();
3739

40+
services.AddScoped<IFunctionCallback, GoToRouterFn>();
41+
3842
return services;
3943
}
4044

‎src/Infrastructure/BotSharp.Core/Conversations/ConversationController.cs‎

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)