LangExtract.Prompt.Builder (LangExtract v0.6.0)

Copy Markdown View Source

Renders Q&A-formatted prompts from a template for LLM extraction.

The framing mirrors upstream langextract's QAPromptGenerator: an Examples heading, Q:/A: pairs (answers are code-fenced by WireFormat.format_extractions/1), and a trailing bare A: that primes the model to emit the artifact directly. Measured on the ner benchmark (2026-07-05 probe series, BASELINE.md): this scaffold cuts output tokens ~20% versus bare concatenation by reducing adaptive-thinking spend, with no alignment cost.

Summary

Functions

build(template, chunk_text)