Class DocumentQueryResult
Contains the result of a document query, including the generated response and references to source passages.
public sealed class DocumentQueryResult
- Inheritance
-
DocumentQueryResult
- Inherited Members
Examples
using var chat = new PdfChat(chatModel, embeddingModel);
await chat.LoadDocumentAsync("report.pdf");
DocumentQueryResult result = await chat.SubmitAsync("What are the key findings?");
Console.WriteLine(result.Response.Completion);
if (result.HasSourceReferences)
{
foreach (var source in result.SourceReferences)
Console.WriteLine($" Source: {source.Name}, Page {source.PageNumber}");
}
Constructors
- DocumentQueryResult(TextGenerationResult, IReadOnlyList<DocumentReference>)
Initializes a new instance of the DocumentQueryResult class.
Properties
- HasSourceReferences
Gets whether source references are available for this result.
- Response
Gets the generated text response.
- SourceReferences
Gets the document passages used to generate the response. May be
nullif the entire document was included inline.