Method ReadNearestRankingAsync
- Namespace
- MailFathom.Application.Agent.Search
- Assembly
- MailFathom.Application.dll
ReadNearestRankingAsync(UserId, RegisteredEmbeddingProfile, EmbeddingVector, int, CancellationToken)
Ranks one person's conversations by how near their embedded messages sit to the query.
Task<IReadOnlyList<AgentConversationSearchHit>> ReadNearestRankingAsync(UserId user, RegisteredEmbeddingProfile profile, EmbeddingVector queryVector, int limit, CancellationToken cancellationToken)
Parameters
userUserIdWhose conversations to rank, which are the only ones read.
profileRegisteredEmbeddingProfileThe space the query was placed in, which is the only one whose vectors are read.
queryVectorEmbeddingVectorWhere the query sits in that space.
limitintThe greatest number of conversations to return, at least one.
cancellationTokenCancellationTokenCancels the read.
Returns
- Task<IReadOnlyList<AgentConversationSearchHit>>
The conversations holding a vector in that space, nearest first and more recent first among equals, each at its nearest entry.
Remarks
A conversation with no vector in that space is absent here and present in the lexical ranking, which is what keeps one written before its messages were embedded findable.
Exceptions
- ArgumentNullException
Thrown when
profileorqueryVectoris null.- ArgumentOutOfRangeException
Thrown when
limitis below one.