Table of Contents

Constructor RagQueryResult

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

RagQueryResult(TextGenerationResult, IReadOnlyList<PartitionSimilarity>)

Initializes a new instance of the RagQueryResult class.

public RagQueryResult(TextGenerationResult response, IReadOnlyList<PartitionSimilarity> retrievedPartitions)

Parameters

response TextGenerationResult

The generated response.

retrievedPartitions IReadOnlyList<PartitionSimilarity>

The partitions used as context, or null.

Examples

// Typically constructed by RagChat.Submit, but can be created manually
// when composing results from custom retrieval pipelines.
var result = new RagQueryResult(generationResult, matchingPartitions);

Console.WriteLine(result.Response.Completion);
Console.WriteLine($"Partitions used: {result.RetrievedPartitions.Count}");

Exceptions

ArgumentNullException

Thrown if response is null.

Share