BotSharp/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Common.cs
2024-09-10 14:02:25 -05:00

13 lines
452 B
C#

namespace BotSharp.Plugin.KnowledgeBase.Services;
public partial class KnowledgeService
{
public async Task<bool> RefreshVectorKnowledgeConfigs(VectorCollectionConfigsModel configs)
{
var db = _services.GetRequiredService<IBotSharpRepository>();
var collections = configs.Collections ?? new();
var saved = db.AddKnowledgeCollectionConfigs(collections, reset: true);
return await Task.FromResult(saved);
}
}