Constructor DocumentSplitting
- Namespace
- LMKit.Extraction
- Assembly
- LM-Kit.NET.dll
DocumentSplitting(LM)
Initializes a new instance of the DocumentSplitting class with the specified vision language model.
public DocumentSplitting(LM model)
Parameters
modelLMA vision-capable LM model to use for boundary detection; cannot be
null. The model must support both text generation (HasTextGeneration) and vision (HasVision).
Examples
// Load a vision-capable model (8B or larger recommended for document splitting)
LM model = LM.LoadFromModelID("qwen3-vl:8b");
// Create a DocumentSplitting instance
DocumentSplitting splitter = new DocumentSplitting(model);
// Optionally configure and run
splitter.Guidance = "The file contains invoices and contracts.";
DocumentSplittingResult result = splitter.Split(new Attachment("batch.pdf"));
Console.WriteLine($"Found {result.DocumentCount} document(s)");
Exceptions
- ArgumentNullException
Thrown when the provided
modelisnull.- InvalidModelException
Thrown when the model does not support text generation, does not have vision capabilities, or has been loaded without weights.