Skip to main content

Module message

Module message 

Source
Expand description

Provider-agnostic conversation types.

Every provider translates to and from these on the wire. Nothing in here knows about Anthropic, OpenAI, or any particular JSON shape.

Structs§

CompletionRequest
One request to a provider. Stateless — the full history goes every time.
CompletionResponse
Message
Pricing
Per-million-token prices. Configured, never guessed — hardcoding a price table guarantees it is wrong within a quarter.
Refusal
ToolSpec
A tool as the model sees it.
Usage

Enums§

Block
One piece of a message. A single assistant turn is often several blocks: thinking, then text, then one or more tool calls.
Effort
How hard the model should work. Maps to Anthropic’s output_config.effort; other providers approximate or ignore it.
Role
StopReason
Why the model stopped generating.

Functions§

image_media_type
The media type for a path, or None when it is not an image this system will send.