Expand description
Conversation message model: Message, its block enums, and the
SystemPrompt / CacheControl support types.
Structs§
- System
Block - One entry inside a
SystemPrompt::Blockssequence. - Tool
Result Content - Body of a tool reply sent back to the model in a
UserBlock::ToolResult.
Enums§
- Assistant
Block - One block inside a
Message::Assistantturn. - Cache
Control - Cache breakpoint placed on a content block, system prompt block, or
tool definition. Providers that support prompt caching (Anthropic
today) read these to decide which prefix is cacheable and at what
TTL; providers without explicit caching ignore the field. The
presence of
cache_controlonly declares intent — the actual cache hit/miss is reported viacrate::Usage::cached_input_tokensand the cache-creation counters. - Message
- One turn in the conversation history exchanged with a provider.
- Source
- Source of an image or document content block.
- System
Prompt - System prompt passed to the provider.
Plain(String)matches the pre-caching API and is whatFrom<String>/From<&str>produce — callers that don’t care about prompt caching keep using strings.Blocks(...)opts in to per-block cache breakpoints (Anthropic emits thesystemfield as an array; other providers concatenate the block texts). - Tool
Result Block - One block inside a
ToolResultContent::blockslist. - User
Block - One block inside a
Message::Userturn.