This commit is contained in:
Jicheng Lu 2024-09-03 22:13:25 -05:00
parent e21a44ec3d
commit 32c99dee5f
16 changed files with 35 additions and 17 deletions

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(TargetFramework)</TargetFramework>

View file

@ -1,9 +1,9 @@
using BotSharp.Abstraction.Knowledges.Enums;
using BotSharp.Abstraction.VectorStorage.Models;
namespace BotSharp.Abstraction.VectorStorage.Helpers;
namespace BotSharp.Abstraction.VectorStorage.Extensions;
public static class VectorStorageHelper
public static class VectorStorageExtension
{
public static string ToQuestionAnswer(this VectorSearchResult data)
{

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>$(TargetFramework)</TargetFramework>

View file

@ -6,6 +6,7 @@ using BotSharp.Abstraction.Routing.Planning;
using BotSharp.Abstraction.Settings;
using BotSharp.Abstraction.Templating;
using BotSharp.Core.Instructs;
using BotSharp.Core.Knowledges.Services;
using BotSharp.Core.Messaging;
using BotSharp.Core.Routing.Planning;
using BotSharp.Core.Templating;
@ -54,6 +55,8 @@ public class ConversationPlugin : IBotSharpPlugin
services.AddScoped<IExecutor, InstructExecutor>();
services.AddScoped<IInstructService, InstructService>();
services.AddScoped<ITokenStatistics, TokenStatistics>();
services.AddScoped<IKnowledgeService, KnowledgeService>();
}
public bool AttachMenu(List<PluginMenuDef> menu)

View file

@ -1,4 +1,7 @@
namespace BotSharp.Plugin.KnowledgeBase.Helpers;
using BotSharp.Abstraction.Knowledges.Settings;
using BotSharp.Abstraction.MLTasks;
namespace BotSharp.Core.Knowledges.Helpers;
public static class KnowledgeSettingHelper
{

View file

@ -1,6 +1,7 @@
using BotSharp.Abstraction.Knowledges.Models;
using System.Text.RegularExpressions;
namespace BotSharp.Plugin.KnowledgeBase.Helpers;
namespace BotSharp.Core.Knowledges.Helpers;
public static class TextChopper
{

View file

@ -1,4 +1,8 @@
namespace BotSharp.Plugin.KnowledgeBase.Services;
using BotSharp.Abstraction.Knowledges.Models;
using BotSharp.Abstraction.VectorStorage.Models;
using BotSharp.Core.Knowledges.Helpers;
namespace BotSharp.Core.Knowledges.Services;
public partial class KnowledgeService
{

View file

@ -1,4 +1,4 @@
namespace BotSharp.Plugin.KnowledgeBase.Services;
namespace BotSharp.Core.Knowledges.Services;
public partial class KnowledgeService
{

View file

@ -1,6 +1,8 @@
using BotSharp.Abstraction.Graph.Models;
using BotSharp.Abstraction.Knowledges.Models;
using BotSharp.Abstraction.VectorStorage.Models;
namespace BotSharp.Plugin.KnowledgeBase.Services;
namespace BotSharp.Core.Knowledges.Services;
public partial class KnowledgeService
{

View file

@ -1,4 +1,6 @@
namespace BotSharp.Plugin.KnowledgeBase.Services;
using BotSharp.Abstraction.VectorStorage.Models;
namespace BotSharp.Core.Knowledges.Services;
public partial class KnowledgeService
{

View file

@ -1,4 +1,10 @@
namespace BotSharp.Plugin.KnowledgeBase.Services;
using BotSharp.Abstraction.Graph;
using BotSharp.Abstraction.Knowledges.Settings;
using BotSharp.Abstraction.MLTasks;
using BotSharp.Abstraction.VectorStorage;
using BotSharp.Core.Knowledges.Helpers;
namespace BotSharp.Core.Knowledges.Services;
public partial class KnowledgeService : IKnowledgeService
{

View file

@ -1,4 +1,4 @@
using BotSharp.Abstraction.VectorStorage.Helpers;
using BotSharp.Abstraction.VectorStorage.Extensions;
namespace BotSharp.Plugin.KnowledgeBase.Functions;

View file

@ -21,7 +21,6 @@ public class KnowledgeBasePlugin : IBotSharpPlugin
return settingService.Bind<KnowledgeBaseSettings>("KnowledgeBase");
});
services.AddScoped<IKnowledgeService, KnowledgeService>();
services.AddSingleton<IPdf2TextConverter, PigPdf2TextConverter>();
services.AddScoped<IAgentUtilityHook, KnowledgeBaseUtilityHook>();
services.AddScoped<IAgentHook, KnowledgeBaseAgentHook>();

View file

@ -31,6 +31,5 @@ global using BotSharp.Abstraction.Agents.Enums;
global using BotSharp.Abstraction.Agents.Models;
global using BotSharp.Abstraction.Functions.Models;
global using BotSharp.Abstraction.Repositories;
global using BotSharp.Plugin.KnowledgeBase.Services;
global using BotSharp.Plugin.KnowledgeBase.Enum;
global using BotSharp.Plugin.KnowledgeBase.Helpers;

View file

@ -28,7 +28,7 @@ global using BotSharp.Abstraction.Knowledges;
global using BotSharp.Abstraction.Knowledges.Settings;
global using BotSharp.Abstraction.Knowledges.Enums;
global using BotSharp.Abstraction.VectorStorage.Models;
global using BotSharp.Abstraction.VectorStorage.Helpers;
global using BotSharp.Abstraction.VectorStorage.Extensions;
global using BotSharp.Plugin.Planner.Hooks;
global using BotSharp.Plugin.Planner.Enums;

View file

@ -82,8 +82,7 @@ public class TwilioVoiceController : TwilioController
}
}
response = new VoiceResponse()
.Redirect(new Uri($"{_settings.CallbackHost}/twilio/voice/{conversationId}/reply/{seqNum}?states={states}"), HttpMethod.Post);
response = new VoiceResponse().Redirect(new Uri($"{_settings.CallbackHost}/twilio/voice/{conversationId}/reply/{seqNum}?states={states}"), HttpMethod.Post);
}
else
{