distillcore
Skip to Content
API Referenceprocess_text()

process_text()

Process raw text through the pipeline (skips extraction).

Signature

def process_text( text: str, *, config: DistillConfig | None = None, filename: str = "input.txt", embed: bool = True, ) -> ProcessingResult:

Parameters

ParameterTypeDefaultDescription
textstrrequiredRaw text to process
configDistillConfigNonePipeline configuration
filenamestr"input.txt"Virtual filename for metadata
embedboolTrueWhether to generate embeddings

Returns

ProcessingResult — same structure as process_document().

Examples

from distillcore import process_text result = process_text( "The court hereby orders that the motion to dismiss is denied...", filename="order.txt", )

Without LLM features

from distillcore import process_text, DistillConfig, DomainConfig result = process_text( "Some text to chunk without any LLM calls.", config=DistillConfig(domain=DomainConfig(), enrich_chunks=False), embed=False, )

Async Version

from distillcore import process_text_async result = await process_text_async("The court hereby orders...")