# LangExtract v0.4.0 - Table of Contents

> Extract structured data from text using LLMs with source grounding.
Maps every extraction back to exact byte positions in the source.
Supports Claude, OpenAI, and Gemini providers. Elixir port of google/langextract.

## Pages

- [LangExtract](readme.md)
- [Changelog](changelog.md)

## Modules

- [LangExtract](LangExtract.md): Extracts structured data from text with source grounding.
Maps extraction strings back to exact byte positions in source text.
- [LangExtract.Alignment.Aligner](LangExtract.Alignment.Aligner.md): Maps extraction strings to byte spans in source text.
- [LangExtract.Alignment.Span](LangExtract.Alignment.Span.md): An aligned extraction with its byte position in the source text.

- [LangExtract.Alignment.Token](LangExtract.Alignment.Token.md): A token with its byte position in the source text.
- [LangExtract.Alignment.Tokenizer](LangExtract.Alignment.Tokenizer.md): Regex-based tokenizer that splits text into tokens with byte offsets.
- [LangExtract.Chunker](LangExtract.Chunker.md): Splits text into sentence-level chunks using the Alignment.Tokenizer.
- [LangExtract.Chunker.Chunk](LangExtract.Chunker.Chunk.md): A chunk of text with its byte offset in the source.

- [LangExtract.Client](LangExtract.Client.md): A configured LLM client for extraction.
- [LangExtract.Extraction](LangExtract.Extraction.md): A single extraction from LLM output.
- [LangExtract.Orchestrator](LangExtract.Orchestrator.md): Wires the full extraction pipeline.
- [LangExtract.Pipeline](LangExtract.Pipeline.md): Extraction pipeline: normalize LLM output, parse extractions, align to source text.

- [LangExtract.Pipeline.ChunkError](LangExtract.Pipeline.ChunkError.md): A failed chunk with its byte position in the source and error reason.

- [LangExtract.Pipeline.Parser](LangExtract.Pipeline.Parser.md): Parses canonical extraction maps into `%Extraction{}` structs.
- [LangExtract.Prompt.Builder](LangExtract.Prompt.Builder.md): Renders Q&A-formatted prompts from a template for LLM extraction.

- [LangExtract.Prompt.ExampleData](LangExtract.Prompt.ExampleData.md): A single few-shot example: source text and expected extractions.

- [LangExtract.Prompt.Template](LangExtract.Prompt.Template.md): Holds the extraction task description and few-shot examples.

- [LangExtract.Prompt.Validator](LangExtract.Prompt.Validator.md): Validates that few-shot examples in a `LangExtract.Prompt.Template` are self-consistent.
- [LangExtract.Prompt.Validator.Issue](LangExtract.Prompt.Validator.Issue.md): Describes a single alignment problem in a few-shot example.

- [LangExtract.Provider](LangExtract.Provider.md): Behaviour for LLM inference providers.
- [LangExtract.Provider.Claude](LangExtract.Provider.Claude.md): Claude (Anthropic) provider for LLM inference.
- [LangExtract.Provider.Gemini](LangExtract.Provider.Gemini.md): Gemini (Google) provider for LLM inference.
- [LangExtract.Provider.OpenAI](LangExtract.Provider.OpenAI.md): OpenAI provider for LLM inference.
- [LangExtract.Serializer](LangExtract.Serializer.md): Serialization and deserialization of extraction results.
- [LangExtract.WireFormat](LangExtract.WireFormat.md): Port between external LLM format and internal domain.

- Exceptions
  - [LangExtract.Prompt.Validator.ValidationError](LangExtract.Prompt.Validator.ValidationError.md): Raised by `LangExtract.Prompt.Validator.validate!/1` when alignment issues are found.

## Mix Tasks

- [mix benchmark.run](Mix.Tasks.Benchmark.Run.md): Run LangExtract benchmark against corpus texts.

