Expand description
Model trait — protocol-agnostic LLM backend interface.
Modules§
- call_
purpose - Conventional values for
CallKind::Auxiliary::purpose. - input_
source - Values for
InputSpan::source.
Structs§
- Call
Origin - Which session issued a call, and what the call is doing there.
- Input
Map - The composition of the user message a turn was started by.
- Input
Span - Model
Error - A failed model call, as the protocol client classified it.
- Model
Message - A message in the model’s conversation history.
- Provider
Search - A web search the provider runs itself, inside the call.
- Search
Hit - One page a provider’s own web search found.
- Stream
Params - Parameters for a streaming LLM call.
- ToolDef
- Tool definition sent to the model.
- Usage
- Usage
Tap - Usage a client has learned of a call so far — the input side, which an
Anthropic stream reports when it opens — and the node the call is charged
to.
ModelEvent::EndTurn’s usage supersedes what was reported. Reporting to a tap nobody made does nothing.
Enums§
- Call
Kind - Effort
- How much work the model puts into a reply. DeepSeek accepts
low,highandmax, foldingmediumandxhighintohigh. - Message
Role - Model
Content Block - Model
Error Kind - What kind of failure a model call had. Assigned once, by the protocol client that saw it; everything above reads it.
- Model
Event - Thinking
Mode - Model thinking/reasoning mode.
Constants§
- IMAGE_
TOKEN_ ESTIMATE - Token cost to charge a
ModelContentBlock::Imagein context-budget estimates.
Traits§
- Model
- Protocol-agnostic LLM client trait.
Functions§
- document_
token_ estimate - Token cost to charge a
ModelContentBlock::Document: a PDF is billed as its text plus a picture per page, roughly 3000 tokens per ~50 KB page, so the estimate follows the decoded size and never drops below an image’s.
Type Aliases§
- Model
Stream - OnSpent
- Told what a metered call used, once.