Packages
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.
Current section
Files
Jump to
Current section
Files
lib/lang_extract/extraction.ex
defmodule LangExtract.Extraction do
@moduledoc """
A single extraction from LLM output.
Contains the entity class, verbatim source text, and arbitrary attributes.
Positional information is added later by the aligner on `%LangExtract.Alignment.Span{}`.
"""
@type t :: %__MODULE__{
class: String.t(),
text: String.t(),
attributes: map()
}
@enforce_keys [:class, :text]
defstruct [:class, :text, attributes: %{}]
end