Constructor DocumentMetadata
DocumentMetadata(Attachment, string, string, MetadataCollection)
Initializes a new instance of the DocumentRag.DocumentMetadata class.
public DocumentMetadata(Attachment attachment, string id = null, string sourceUri = null, MetadataCollection customMetadata = null)
Parameters
attachmentAttachmentidstringAn optional unique identifier for the document. If not specified or empty, a new Guid string is generated. Specify an explicit ID when you need to delete or update the document later using DeleteDocumentAsync(string, string, CancellationToken).
sourceUristringAn optional URI (URL, path, or identifier) for locating the original document.
customMetadataMetadataCollectionOptional custom metadata to attach to all sections from this document.
Exceptions
- ArgumentNullException
Thrown if
attachmentisnull.
DocumentMetadata(string, string, string, MetadataCollection)
Initializes a new instance of the DocumentRag.DocumentMetadata class with a specified name.
public DocumentMetadata(string name, string id = null, string sourceUri = null, MetadataCollection customMetadata = null)
Parameters
namestringThe display name for the document.
idstringAn optional unique identifier for the document. If not specified or empty, a new Guid string is generated. Specify an explicit ID when you need to delete or update the document later using DeleteDocumentAsync(string, string, CancellationToken).
sourceUristringAn optional URI (URL, path, or identifier) for locating the original document.
customMetadataMetadataCollectionOptional custom metadata to attach to all sections from this document.
Exceptions
- ArgumentException
Thrown if
nameisnull, empty, or whitespace.