# `LangExtract.Orchestrator`
[🔗](https://github.com/mdepolli/lang_extract/blob/v0.10.0/lib/lang_extract/orchestrator.ex#L1)

Wires the full extraction pipeline.

Builds a prompt, calls the LLM provider, normalizes and parses the response,
aligns extractions to source text, and returns enriched spans.

Auto-chunks source text by default (1000 characters). Customize with
`:max_chunk_chars`.

Two consumption modes over one chunk pipeline: `run/4` collects everything
and restores document order; `stream/4` yields each chunk's outcome the
moment it completes.

Internal — no stability guarantees; see the README's "Stability"
section. Documented because it explains how the library works, not
because it is API.

# `run`

```elixir
@spec run(LangExtract.Client.t(), String.t(), LangExtract.Template.t(), keyword()) ::
  LangExtract.Result.t()
```

# `stream`

```elixir
@spec stream(LangExtract.Client.t(), String.t(), LangExtract.Template.t(), keyword()) ::
  Enumerable.t()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
