LangExtract.ChunkError (LangExtract v0.9.0)

Copy Markdown View Source

A failed chunk with its byte position in the source and error reason.

reason is deliberately open (term/0): it funnels whatever the failing layer reported. Common shapes, non-exhaustive:

  • LangExtract.Provider.error/0 — the LLM request failed, e.g. {:rate_limited, ms} or :server_error once retries are exhausted
  • {:invalid_format, message} or :missing_extractions — the LLM reply didn't parse
  • {:task_exit, reason} — the chunk task crashed or timed out
  • :drained — the runner shut down before the chunk started

Summary

Functions

Builds an error carrying chunk's byte range.

Types

t()

@type t() :: %LangExtract.ChunkError{
  byte_end: non_neg_integer(),
  byte_start: non_neg_integer(),
  reason: term()
}

Functions

from_chunk(chunk, reason)

@spec from_chunk(LangExtract.Chunker.Chunk.t(), term()) :: t()

Builds an error carrying chunk's byte range.