Pixir.Providers.ErrBody (pixir v0.1.12)

Copy Markdown View Source

Shared bounded error-body capture for every current consumer.

Issue #268 item 1 keeps the cap in one place. Issue #306 adds explicit drop provenance for OpenAI, Anthropic, and ModelsRefresh so an exactly-full body is distinct from one whose trailing bytes were discarded.

Summary

Functions

Append bytes while retaining at most max_bytes/0 and recording any drop.

Return the retained body bytes for classification or bounded diagnostics.

Maximum number of error-body bytes retained before classification.

Create an empty bounded capture with no discarded-byte evidence.

Whether at least one received byte was discarded from this capture.

Types

t()

@opaque t()

Functions

append(capture, data)

@spec append(t(), binary()) :: t()

Append bytes while retaining at most max_bytes/0 and recording any drop.

body(err_body)

@spec body(t()) :: binary()

Return the retained body bytes for classification or bounded diagnostics.

max_bytes()

@spec max_bytes() :: pos_integer()

Maximum number of error-body bytes retained before classification.

new()

@spec new() :: t()

Create an empty bounded capture with no discarded-byte evidence.

truncated?(err_body)

@spec truncated?(t()) :: boolean()

Whether at least one received byte was discarded from this capture.