Expand description
Typed model requests and runtime accounting, independent of any provider SDK. Every fragment requires a source and role. Estimates, tokenizer-measured document budgets, and reported usage are distinct; none implies the others.
Structs§
- Byte
Estimator - Explicit heuristic policy. Image transport bytes are never treated as text. This estimate excludes provider framing and is not a tokenizer count.
- Model
Request - A complete, attributed model request. Constructed only via
ModelRequestBuilder. - Model
Request Builder - Prompt
Fragment - A source-attributed piece of a model request. Fields are private; the only constructors require attribution at the call site.
- Reported
Usage - Provider-reported usage for one model call. Input/cache lanes are disjoint; reasoning is a subset of output and must not be added to the output total.
- Request
Estimate - Categorized estimate. Total derives from categories instead of being a separately mutable field that could drift from them.
- Source
Estimate - One source’s heuristic allocation, not provider-reported category usage.
- Token
Usage - Usage for one call.
estimate: Nonemeans source attribution is unavailable (for example, a backend assembled the prompt), not zero category usage. - Tool
Definition - A tool definition offered to the model. Counted under
ContentSource::ToolDefinitionsin attribution. - Tool
UseId - Opaque provider-neutral tool-call identity. The caller generates IDs; HTMLP has no UUID, clock, or random-number dependency.
Enums§
- Content
Block - Provider-neutral content block.
- Content
Source - The origin category of a piece of model-bound content.
- Role
- Message role; source attribution remains independent of role.
- Thinking
Level - Reasoning/thinking effort. Providers map this to their native knob
(Anthropic
budget_tokens, OpenAIreasoning_effort).
Constants§
- TEXT_
ONLY_ IMAGE_ NOTE - Shown to the model in place of an image the active model cannot view. Reads as a bracketed aside so tool-result descriptions (“Image foo.png: 800×600 …”) still read as the metadata line it accompanies.