BotSharp/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Delete.cs
2024-08-09 16:03:29 -05:00

19 lines
553 B
C#

namespace BotSharp.Plugin.KnowledgeBase.Services;
public partial class KnowledgeService
{
public async Task<bool> DeleteKnowledgeCollectionData(string collectionName, string id)
{
try
{
var db = GetVectorDb();
return await db.DeleteCollectionData(collectionName, id);
}
catch (Exception ex)
{
_logger.LogWarning($"Error when deleting knowledge collection data ({collectionName}-{id}). {ex.Message}\r\n{ex.InnerException}");
return false;
}
}
}