41 references to Throw
Microsoft.Extensions.DataIngestion (41)
Chunkers\ElementsChunker.cs (1)
22
_ =
Throw
.IfNull(options);
Chunkers\HeaderChunker.cs (1)
35
_ =
Throw
.IfNull(document);
Chunkers\IngestionChunkerOptions.cs (5)
26
Tokenizer =
Throw
.IfNull(tokenizer);
42
_ =
Throw
.IfLessThanOrEqual(value, 0);
46
Throw
.ArgumentOutOfRangeException(nameof(value), "Chunk size must be greater than chunk overlap.");
75
if (
Throw
.IfLessThan(value, 0) >= MaxTokensPerChunk)
77
Throw
.ArgumentOutOfRangeException(nameof(value), "Chunk overlap must be less than chunk size.");
Chunkers\SectionChunker.cs (1)
31
_ =
Throw
.IfNull(document);
Chunkers\SemanticSimilarityChunker.cs (3)
40
Throw
.ArgumentOutOfRangeException(nameof(thresholdPercentile), "Threshold percentile must be between 0 and 100.");
50
_ =
Throw
.IfNull(document);
83
Throw
.InvalidOperationException("The number of embeddings returned does not match the number of document elements.");
IngestionPipeline.cs (7)
48
_reader =
Throw
.IfNull(reader);
49
_chunker =
Throw
.IfNull(chunker);
50
_writer =
Throw
.IfNull(writer);
83
Throw
.IfNull(directory);
84
Throw
.IfNullOrEmpty(searchPattern);
85
Throw
.IfOutOfRange((int)searchOption, (int)SearchOption.TopDirectoryOnly, (int)SearchOption.AllDirectories);
109
Throw
.IfNull(files);
IngestionPipelineOptions.cs (1)
23
set => field =
Throw
.IfNullOrEmpty(value);
IngestionResult.cs (1)
36
DocumentId =
Throw
.IfNullOrEmpty(documentId);
Processors\ClassificationEnricher.cs (4)
35
_options =
Throw
.IfNull(options).Clone();
59
Throw
.ArgumentException(nameof(predefinedClasses), "Predefined classes must be provided.");
69
Throw
.ArgumentException(nameof(predefinedClasses), $"Fallback class '{fallbackClass}' must not be one of the predefined classes.");
72
Throw
.ArgumentException(nameof(predefinedClasses), $"Duplicate class found: '{predefinedClass}'.");
Processors\EnricherOptions.cs (2)
21
ChatClient =
Throw
.IfNull(chatClient);
46
public int BatchSize { get; set => field =
Throw
.IfLessThanOrEqual(value, 0); } = 20;
Processors\ImageAlternativeTextEnricher.cs (2)
30
_options =
Throw
.IfNull(options).Clone();
38
_ =
Throw
.IfNull(document);
Processors\KeywordEnricher.cs (4)
41
_options =
Throw
.IfNull(options).Clone();
45
?
Throw
.IfOutOfRange(confidenceThreshold.Value, 0.0, 1.0, nameof(confidenceThreshold))
48
?
Throw
.IfLessThanOrEqual(maxKeywords.Value, 0, nameof(maxKeywords))
75
Throw
.ArgumentException(nameof(predefinedKeywords), $"Duplicate keyword found: '{keyword}'");
Processors\SentimentEnricher.cs (2)
32
_options =
Throw
.IfNull(options).Clone();
34
double threshold = confidenceThreshold.HasValue ?
Throw
.IfOutOfRange(confidenceThreshold.Value, 0.0, 1.0, nameof(confidenceThreshold)) : 0.7;
Processors\SummaryEnricher.cs (2)
32
_options =
Throw
.IfNull(options).Clone();
34
int wordCount = maxWordCount.HasValue ?
Throw
.IfLessThanOrEqual(maxWordCount.Value, 0, nameof(maxWordCount)) : 100;
Utils\Batching.cs (1)
26
_ =
Throw
.IfNull(chunks);
Writers\VectorStoreWriter.cs (3)
42
_vectorStore =
Throw
.IfNull(vectorStore);
43
_dimensionCount =
Throw
.IfLessThanOrEqual(dimensionCount, 0);
61
_ =
Throw
.IfNull(chunks);
Writers\VectorStoreWriterOptions.cs (1)
19
set => field =
Throw
.IfNullOrEmpty(value);