LangExtract.Prompt.ExampleData (LangExtract v0.6.0)

Copy Markdown View Source

A single few-shot example: a sample text paired with the extractions expected from it.

The extractions are the answer key for the sample text. They pin down everything the template description leaves open: the class vocabulary, the span granularity, which attributes to attach, and the output shape itself — the class name becomes the JSON key in the model's reply.

Each extraction's text must appear verbatim in this example's text: examples double as alignment ground truth, and LangExtract.Prompt.Validator checks this before any tokens are spent.

Summary

Types

t()

@type t() :: %LangExtract.Prompt.ExampleData{
  extractions: [LangExtract.Extraction.t()],
  text: String.t()
}