Expand description
Metadata-only structural description of an Anthropic Messages request (Task 8). Every function here consumes trusted structural inputs — the already-sanitized message array, the caller-supplied system prompt, the registered tool schemas, and the exact serialized wire bytes — and produces only counts, byte lengths, enums, validated IDs, and keyed digests. No raw string is ever retained.
Functions§
- anthropic_
request_ structure - Build the structural description of one Anthropic request.
- retry_
class_ for_ status - Map an Anthropic HTTP failure status to a coarse retry class.
- retry_
class_ for_ stream_ error - Map an in-stream Anthropic error type (already vetted upstream) to a
coarse retry class.
Nonemeans the stream died at transport level. - stop_
reason_ from_ wire - Normalize an Anthropic wire
stop_reasoninto the trace enum. Unknown values collapse toOther— the raw string is never stored.