BotSharp/src/Infrastructure/BotSharp.Abstraction/VectorStorage/IVectorDb.cs
Jicheng Lu e96b217dfe 1. split knowledge menu
2. refine vector db
2024-08-20 13:32:22 -05:00

16 lines
761 B
C#

using BotSharp.Abstraction.VectorStorage.Models;
namespace BotSharp.Abstraction.VectorStorage;
public interface IVectorDb
{
string Name { get; }
Task<IEnumerable<string>> GetCollections();
Task<StringIdPagedItems<VectorCollectionData>> GetCollectionData(string collectionName, VectorFilter filter);
Task CreateCollection(string collectionName, int dim);
Task<bool> Upsert(string collectionName, Guid id, float[] vector, string text, Dictionary<string, string>? payload = null);
Task<IEnumerable<VectorCollectionData>> Search(string collectionName, float[] vector, IEnumerable<string>? fields, int limit = 5, float confidence = 0.5f, bool withVector = false);
Task<bool> DeleteCollectionData(string collectionName, Guid id);
}