Method Import
Import(Attachment, TextChunking, string, string, CancellationToken)
Imports content from a single Attachment into a DataSource by creating a new section.
public DataSource Import(Attachment attachment, TextChunking textChunking, string dataSourceIdentifier, string sectionIdentifier, CancellationToken cancellationToken = default)
Parameters
attachmentAttachmentThe attachment containing the content to import.
textChunkingTextChunkingSpecifies how to split the extracted text into chunks.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as a new section; otherwise, a new data source is created.
sectionIdentifierstringThe identifier for the new section created from the attachment's content.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Exceptions
- ArgumentNullException
Thrown if
attachment,dataSourceIdentifier, orsectionIdentifieris null or empty.
Import(Attachment, string, string, CancellationToken)
Imports content from a single Attachment into a DataSource by creating a new section.
public DataSource Import(Attachment attachment, string dataSourceIdentifier, string sectionIdentifier, CancellationToken cancellationToken = default)
Parameters
attachmentAttachmentThe attachment containing the content to import.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as a new section; otherwise, a new data source is created.
sectionIdentifierstringThe identifier for the new section created from the attachment's content.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Exceptions
- ArgumentNullException
Thrown if
attachment,dataSourceIdentifier, orsectionIdentifieris null or empty.
Import(Attachment, TextChunking, string, string, MetadataCollection, CancellationToken)
Imports content from a single Attachment into a DataSource by creating a new section and attaching additional metadata.
public DataSource Import(Attachment attachment, TextChunking textChunking, string dataSourceIdentifier, string sectionIdentifier, MetadataCollection additionalMetadata, CancellationToken cancellationToken = default)
Parameters
attachmentAttachmentThe attachment containing the content to import.
textChunkingTextChunkingSpecifies how to split the extracted text into chunks.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as a new section; otherwise, a new data source is created.
sectionIdentifierstringThe identifier for the new section created from the attachment's content.
additionalMetadataMetadataCollectionAdditional metadata to associate with the imported section.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Import(Attachment, string, string, MetadataCollection, CancellationToken)
Imports content from a single Attachment into a DataSource by creating a new section and attaching additional metadata.
public DataSource Import(Attachment attachment, string dataSourceIdentifier, string sectionIdentifier, MetadataCollection additionalMetadata, CancellationToken cancellationToken = default)
Parameters
attachmentAttachmentThe attachment containing the content to import.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as a new section; otherwise, a new data source is created.
sectionIdentifierstringThe identifier for the new section created from the attachment's content.
additionalMetadataMetadataCollectionAdditional metadata to associate with the imported section.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Import(IList<Attachment>, string, IList<string>, IList<MetadataCollection>, CancellationToken)
Imports content from multiple Attachment instances into a DataSource, creating a new section for each attachment.
public DataSource Import(IList<Attachment> attachments, string dataSourceIdentifier, IList<string> sectionIdentifiers, IList<MetadataCollection> metadataCollections = null, CancellationToken cancellationToken = default)
Parameters
attachmentsIList<Attachment>A list of attachments containing the content to import.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as new sections; otherwise, a new data source is created.
sectionIdentifiersIList<string>A list of unique identifiers for the sections corresponding to each attachment. The number of identifiers must match the number of attachments.
metadataCollectionsIList<MetadataCollection>An optional list of metadata collections to associate with each imported section. If provided, its count must match the number of attachments.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Exceptions
- ArgumentNullException
Thrown if
attachments,dataSourceIdentifier, orsectionIdentifiersis null or empty.- ArgumentOutOfRangeException
Thrown if the count of
sectionIdentifiers(ormetadataCollections, if provided) does not match the number of attachments.
Import(IList<Attachment>, TextChunking, string, IList<string>, IList<MetadataCollection>, CancellationToken)
Imports content from multiple Attachment instances into a DataSource, creating a new section for each attachment.
public DataSource Import(IList<Attachment> attachments, TextChunking textChunking, string dataSourceIdentifier, IList<string> sectionIdentifiers, IList<MetadataCollection> metadataCollections = null, CancellationToken cancellationToken = default)
Parameters
attachmentsIList<Attachment>A list of attachments containing the content to import.
textChunkingTextChunkingSpecifies how to split the extracted text into chunks.
dataSourceIdentifierstringThe unique identifier for the target DataSource. If a matching data source exists, the content is added as new sections; otherwise, a new data source is created.
sectionIdentifiersIList<string>A list of unique identifiers for the sections corresponding to each attachment. The number of identifiers must match the number of attachments.
metadataCollectionsIList<MetadataCollection>An optional list of metadata collections to associate with each imported section. If provided, its count must match the number of attachments.
cancellationTokenCancellationTokenAn optional cancellation token to cancel the operation.
Returns
- DataSource
The DataSource containing the imported content.
Exceptions
- ArgumentNullException
Thrown if
attachments,dataSourceIdentifier, orsectionIdentifiersis null or empty.- ArgumentOutOfRangeException
Thrown if the count of
sectionIdentifiers(ormetadataCollections, if provided) does not match the number of attachments.