Table of Contents

Method QueryPartitionsAsync

Namespace
LMKit.Retrieval
Assembly
LM-Kit.NET.dll

QueryPartitionsAsync(string, IEnumerable<TextPartitionSimilarity>, IConversation, CancellationToken)

Asynchronously generates a text result by querying the specified text partitions and initiating a conversation within the provided chat context.

public Task<TextGenerationResult> QueryPartitionsAsync(string query, IEnumerable<RagEngine.TextPartitionSimilarity> partitionSimilarities, IConversation chat, CancellationToken cancellationToken = default)

Parameters

query string

The query string used as the basis for generating the text result.

partitionSimilarities IEnumerable<RagEngine.TextPartitionSimilarity>

A collection of RagEngine.TextPartitionSimilarity instances representing the similarities found within text partitions, typically returned by the FindMatchingPartitions(string, int, float, bool, CancellationToken) method.

chat IConversation

An instance of IConversation representing the chat context in which the query will be submitted and processed.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the operation if necessary.

Returns

Task<TextGenerationResult>

A task representing the asynchronous operation, which upon completion returns a TextGenerationResult object containing the generated text result based on the query and specified partitions.