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)
26Tokenizer = Throw.IfNull(tokenizer); 42_ = Throw.IfLessThanOrEqual(value, 0); 46Throw.ArgumentOutOfRangeException(nameof(value), "Chunk size must be greater than chunk overlap."); 75if (Throw.IfLessThan(value, 0) >= MaxTokensPerChunk) 77Throw.ArgumentOutOfRangeException(nameof(value), "Chunk overlap must be less than chunk size.");
Chunkers\SectionChunker.cs (1)
31_ = Throw.IfNull(document);
Chunkers\SemanticSimilarityChunker.cs (3)
40Throw.ArgumentOutOfRangeException(nameof(thresholdPercentile), "Threshold percentile must be between 0 and 100."); 50_ = Throw.IfNull(document); 83Throw.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); 83Throw.IfNull(directory); 84Throw.IfNullOrEmpty(searchPattern); 85Throw.IfOutOfRange((int)searchOption, (int)SearchOption.TopDirectoryOnly, (int)SearchOption.AllDirectories); 109Throw.IfNull(files);
IngestionPipelineOptions.cs (1)
23set => field = Throw.IfNullOrEmpty(value);
IngestionResult.cs (1)
36DocumentId = Throw.IfNullOrEmpty(documentId);
Processors\ClassificationEnricher.cs (4)
35_options = Throw.IfNull(options).Clone(); 59Throw.ArgumentException(nameof(predefinedClasses), "Predefined classes must be provided."); 69Throw.ArgumentException(nameof(predefinedClasses), $"Fallback class '{fallbackClass}' must not be one of the predefined classes."); 72Throw.ArgumentException(nameof(predefinedClasses), $"Duplicate class found: '{predefinedClass}'.");
Processors\EnricherOptions.cs (2)
21ChatClient = Throw.IfNull(chatClient); 46public 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)) 75Throw.ArgumentException(nameof(predefinedKeywords), $"Duplicate keyword found: '{keyword}'");
Processors\SentimentEnricher.cs (2)
32_options = Throw.IfNull(options).Clone(); 34double 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(); 34int 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)
19set => field = Throw.IfNullOrEmpty(value);