A successfully processed chunk: its byte range in the source and the spans extracted from it.
The per-chunk success unit yielded by LangExtract.stream/4, sibling of
LangExtract.ChunkError. Span byte offsets are already adjusted
to the original document, not the chunk.
Summary
Functions
Builds a result carrying a chunk-like map's byte range and the request's usage.
Builds a result for an explicit byte range and the request's usage.
Types
@type t() :: %LangExtract.ChunkResult{ byte_end: non_neg_integer(), byte_start: non_neg_integer(), spans: [LangExtract.Span.t()], usage: LangExtract.Provider.Response.usage() | nil }
Functions
@spec from_chunk( %{ :byte_start => non_neg_integer(), :byte_end => non_neg_integer(), optional(any()) => any() }, [LangExtract.Span.t()], LangExtract.Provider.Response.usage() | nil ) :: t()
Builds a result carrying a chunk-like map's byte range and the request's usage.
Accepts any map with integer :byte_start / :byte_end (including
%LangExtract.Chunker.Chunk{}) so Core stays free of an Advanced-tier
type dependency.
@spec from_range( non_neg_integer(), non_neg_integer(), [LangExtract.Span.t()], LangExtract.Provider.Response.usage() | nil ) :: t()
Builds a result for an explicit byte range and the request's usage.
Prefer this over from_chunk/3 when you already have the range — Core
does not type-depend on Advanced Chunker.Chunk.