Files
xSaherElmAiApi/Interfaces/IXInMemoryVectorStore.cs
T
2026-10-25 17:58:05 +03:30

49 lines
1.2 KiB
C#

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
);
}
}