2024-08-15 23:19:10 +00:00
|
|
|
using BotSharp.Abstraction.Graph.Models;
|
|
|
|
|
using BotSharp.Abstraction.VectorStorage.Models;
|
|
|
|
|
|
2023-06-17 02:42:35 +00:00
|
|
|
namespace BotSharp.Abstraction.Knowledges;
|
|
|
|
|
|
|
|
|
|
public interface IKnowledgeService
|
|
|
|
|
{
|
2024-08-29 19:30:47 +00:00
|
|
|
#region Vector
|
2024-09-09 19:16:09 +00:00
|
|
|
Task<bool> CreateVectorCollection(string collectionName, string collectionType, int dimension, string provider, string model);
|
2024-08-29 19:30:47 +00:00
|
|
|
Task<bool> DeleteVectorCollection(string collectionName);
|
2024-09-09 19:16:09 +00:00
|
|
|
Task<IEnumerable<string>> GetVectorCollections(string type);
|
2024-08-15 23:19:10 +00:00
|
|
|
Task<IEnumerable<VectorSearchResult>> SearchVectorKnowledge(string query, string collectionName, VectorSearchOptions options);
|
2024-08-23 18:49:06 +00:00
|
|
|
Task<StringIdPagedItems<VectorSearchResult>> GetPagedVectorCollectionData(string collectionName, VectorFilter filter);
|
2024-08-15 23:19:10 +00:00
|
|
|
Task<bool> DeleteVectorCollectionData(string collectionName, string id);
|
2024-08-23 16:25:44 +00:00
|
|
|
Task<bool> CreateVectorCollectionData(string collectionName, VectorCreateModel create);
|
2024-08-23 03:13:40 +00:00
|
|
|
Task<bool> UpdateVectorCollectionData(string collectionName, VectorUpdateModel update);
|
2024-08-29 19:30:47 +00:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Graph
|
2024-08-15 23:19:10 +00:00
|
|
|
Task<GraphSearchResult> SearchGraphKnowledge(string query, GraphSearchOptions options);
|
2024-09-09 15:00:46 +00:00
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#region Document
|
2024-09-10 19:02:25 +00:00
|
|
|
Task<UploadKnowledgeResponse> UploadKnowledgeDocuments(string collectionName, IEnumerable<ExternalFileModel> files);
|
2024-09-17 17:50:39 +00:00
|
|
|
Task<bool> DeleteKnowledgeDocument(string collectionName, Guid fileId);
|
2024-09-13 22:23:05 +00:00
|
|
|
Task<PagedItems<KnowledgeFileModel>> GetPagedKnowledgeDocuments(string collectionName, KnowledgeFileFilter filter);
|
2024-09-17 17:50:39 +00:00
|
|
|
Task<FileBinaryDataModel?> GetKnowledgeDocumentBinaryData(string collectionName, Guid fileId);
|
2024-08-29 19:30:47 +00:00
|
|
|
#endregion
|
2024-09-09 16:32:31 +00:00
|
|
|
|
|
|
|
|
#region Common
|
|
|
|
|
Task<bool> RefreshVectorKnowledgeConfigs(VectorCollectionConfigsModel configs);
|
|
|
|
|
#endregion
|
2023-06-17 02:42:35 +00:00
|
|
|
}
|