This commit is contained in:
2026-10-25 17:58:05 +03:30
parent 429b97cded
commit 47d8a19423
5 changed files with 275 additions and 2 deletions
+48
View File
@@ -0,0 +1,48 @@
using System;
using xAiApi.Models;
using xAiModels.Models.Dtos;
using System.Collections.Generic;
namespace xAiApi.Interfaces
{
public interface IXInMemoryVectorStore
{
int Count { get; }
int RemoveExpired();
Guid CreateSession(
string ownerId = null,
TimeSpan? ttl = null
);
Guid CreateSession(
IEnumerable<XAiVectorDto> vectors,
string ownerId = null,
TimeSpan? ttl = null
);
bool Replace(
Guid sessionId,
IEnumerable<XAiVectorDto> vectors,
string ownerId = null
);
bool Add(
Guid sessionId,
IEnumerable<XAiVectorDto> vectors,
string ownerId = null
);
IList<XAiVectorSearchResult> Search(
Guid sessionId,
ReadOnlyMemory<float> queryEmbedding,
int topK = 5,
float minScore = 0f,
string ownerId = null
);
bool TryGet(
Guid sessionId,
out XAiDocumentSession session,
string ownerId = null
);
bool Remove(
Guid sessionId,
string ownerId = null
);
}
}