Class DocumentReference
Represents a reference to a specific location within a document, retrieved during a retrieval operation.
public sealed class DocumentReference
- Inheritance
-
DocumentReference
- Inherited Members
Examples
var result = await chat.SubmitAsync("What are the key findings?");
foreach (var reference in result.SourceReferences)
{
Console.WriteLine($"[{reference.Name}, p.{reference.PageNumber}] " +
$"(Score: {reference.SimilarityScore:P1})");
Console.WriteLine($" {reference.Excerpt}");
}
Properties
- Excerpt
Gets the retrieved text excerpt.
- Id
Gets the unique identifier of the source document, or an empty string if unavailable.
- Metadata
Gets the complete metadata collection associated with this document reference.
- Name
Gets the name of the source document.
- PageNumber
Gets the page number within the document, or 0 if unavailable.
- SimilarityScore
Gets the similarity score between the query and this partition (0.0 to 1.0).
- SourceUri
Gets the source URI of the document, or an empty string if not specified during import.
Methods
- FromPartitions(IEnumerable<PartitionSimilarity>)
Creates a list of DocumentReference instances from a collection of partition similarities.