Table of Contents

Method ClearContent

Namespace
LMKit.Extraction
Assembly
LM-Kit.NET.dll

ClearContent()

Removes all previously set input (both text and attachments) so that no content remains for extraction.

public void ClearContent()

Examples

var te = new TextExtraction(LM.LoadFromModelID("lmkit-tasks:4b-preview"));
te.Elements = new List<TextExtractionElement> { new TextExtractionElement("Title", ElementType.String) };
te.SetContent("First document");
var r1 = te.Parse();

te.ClearContent();   // reuse the same instance for a new document
te.SetContent("Second document");
var r2 = te.Parse();

Remarks

After calling ClearContent(), the internal LMKit.Extraction.ExtractionInput will be empty. Any subsequent Parse(CancellationToken) or ParseAsync(CancellationToken) invocation will throw InvalidOperationException unless new content is provided via SetContent(string), SetContent(Attachment), or SetContent(IEnumerable<Attachment>).