diff --git a/src/Infrastructure/BotSharp.Core/BotSharpServiceCollectionExtensions.cs b/src/Infrastructure/BotSharp.Core/BotSharpServiceCollectionExtensions.cs index ae315146..9081ca05 100644 --- a/src/Infrastructure/BotSharp.Core/BotSharpServiceCollectionExtensions.cs +++ b/src/Infrastructure/BotSharp.Core/BotSharpServiceCollectionExtensions.cs @@ -37,7 +37,6 @@ public static class BotSharpServiceCollectionExtensions services.AddScoped(); - services.AddScoped(); services.AddScoped(); return services; diff --git a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.GetChatCompletionsAsyncRecursively.cs b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.GetChatCompletionsAsyncRecursively.cs index c1fd2e30..3f56f97b 100644 --- a/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.GetChatCompletionsAsyncRecursively.cs +++ b/src/Infrastructure/BotSharp.Core/Conversations/Services/ConversationService.GetChatCompletionsAsyncRecursively.cs @@ -21,8 +21,8 @@ public partial class ConversationService currentRecursiveDepth++; if (currentRecursiveDepth > maxRecursiveDepth) { - _logger.LogError($"Exceed max current recursive depth."); - await HandleAssistantMessage(new RoleDialogModel(AgentRole.Assistant, "System has exception, please try later.") + _logger.LogError($"Exceeded max recursive depth."); + await HandleAssistantMessage(new RoleDialogModel(AgentRole.Assistant, "I'm sorry, can you see it again?") { CurrentAgentId = agent.Id, Channel = wholeDialogs.Last().Channel diff --git a/src/Infrastructure/BotSharp.Core/Functions/GoToRouterFn.cs b/src/Infrastructure/BotSharp.Core/Functions/GoToRouterFn.cs deleted file mode 100644 index e7a3455a..00000000 --- a/src/Infrastructure/BotSharp.Core/Functions/GoToRouterFn.cs +++ /dev/null @@ -1,27 +0,0 @@ -using BotSharp.Abstraction.Conversations.Models; -using BotSharp.Abstraction.Functions; -using BotSharp.Abstraction.Functions.Models; - -namespace BotSharp.Core.Functions; - -public class GoToRouterFn : IFunctionCallback -{ - public string Name => "go_to_router"; - private readonly IServiceProvider _services; - - public GoToRouterFn(IServiceProvider services) - { - _services = services; - } - - public async Task Execute(RoleDialogModel message) - { - var settings = _services.GetRequiredService(); - message.CurrentAgentId = settings.RouterId; - - var result = new FunctionExecutionValidationResult("true"); - message.ExecutionResult = JsonSerializer.Serialize(result); - - return true; - } -}