BotSharp/src/Plugins/BotSharp.Plugin.KnowledgeBase/Services/KnowledgeService.Delete.cs

19 lines
553 B
C#
Raw Normal View History

2024-08-06 21:02:02 +00:00
namespace BotSharp.Plugin.KnowledgeBase.Services;
public partial class KnowledgeService
{
2024-08-08 22:15:51 +00:00
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;
}
}
2024-08-06 21:02:02 +00:00
}