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
lang_extract lib lang_extract client.ex
Raw

lib/lang_extract/client.ex

defmodule LangExtract.Client do
@moduledoc """
A configured LLM client for extraction.
Created via `LangExtract.new/2`. Holds the provider module and its options.
"""
@type t :: %__MODULE__{
provider: module(),
options: keyword(),
http_client: Req.Request.t() | nil
}
@derive {Inspect, except: [:options, :http_client]}
@enforce_keys [:provider]
defstruct [:provider, :http_client, options: []]
end