2024-08-15 23:19:10 +00:00
|
|
|
using BotSharp.Abstraction.VectorStorage.Models;
|
|
|
|
|
|
2023-06-26 23:08:24 +00:00
|
|
|
namespace BotSharp.Abstraction.VectorStorage;
|
2023-06-18 02:56:22 +00:00
|
|
|
|
|
|
|
|
public interface IVectorDb
|
|
|
|
|
{
|
2024-08-31 00:31:18 +00:00
|
|
|
string Provider { get; }
|
2024-09-24 20:34:47 +00:00
|
|
|
|
|
|
|
|
Task<bool> DoesCollectionExist(string collectionName);
|
2024-08-08 22:15:51 +00:00
|
|
|
Task<IEnumerable<string>> GetCollections();
|
2024-08-23 16:25:44 +00:00
|
|
|
Task<StringIdPagedItems<VectorCollectionData>> GetPagedCollectionData(string collectionName, VectorFilter filter);
|
|
|
|
|
Task<IEnumerable<VectorCollectionData>> GetCollectionData(string collectionName, IEnumerable<Guid> ids, bool withPayload = false, bool withVector = false);
|
2024-08-29 19:30:47 +00:00
|
|
|
Task<bool> CreateCollection(string collectionName, int dimension);
|
|
|
|
|
Task<bool> DeleteCollection(string collectionName);
|
2024-09-29 01:00:35 +00:00
|
|
|
Task<bool> Upsert(string collectionName, Guid id, float[] vector, string text, Dictionary<string, object>? payload = null);
|
2024-08-15 23:19:10 +00:00
|
|
|
Task<IEnumerable<VectorCollectionData>> Search(string collectionName, float[] vector, IEnumerable<string>? fields, int limit = 5, float confidence = 0.5f, bool withVector = false);
|
2024-09-10 19:02:25 +00:00
|
|
|
Task<bool> DeleteCollectionData(string collectionName, List<Guid> ids);
|
2024-09-18 21:17:54 +00:00
|
|
|
Task<bool> DeleteCollectionAllData(string collectionName);
|
2023-06-18 02:56:22 +00:00
|
|
|
}
|