Table of Contents

Method QueryPartitions

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

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

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

public TextGenerationResult QueryPartitions(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

TextGenerationResult

A TextGenerationResult object containing the generated text result based on the query and specified partitions.