Normandy.Components.ContentBlock.Text
(normandy v0.6.1)
View Source
Represents a text content block inside a multimodal message.
Used as part of a list of content blocks in Normandy.Components.Message
when a message mixes text with images or documents.
Cache control
An optional cache_control field carries an Anthropic prompt-cache
breakpoint annotation that the adapter ships verbatim on the wire.
Use with_cache/1 for the default ephemeral type, or with_cache/2
for a custom map (e.g. %{"type" => "ephemeral", "ttl" => "1h"}).
Atom keys are accepted and stringified at serialization time.
Summary
Functions
Builds a text content block from a string.
Converts the block into the Anthropic/Claudio content-block map shape
(string keys). Includes cache_control only when set.
Annotates this block with an ephemeral cache breakpoint.
Annotates this block with a caller-supplied cache_control map.
Types
Functions
Builds a text content block from a string.
Converts the block into the Anthropic/Claudio content-block map shape
(string keys). Includes cache_control only when set.
Annotates this block with an ephemeral cache breakpoint.
Equivalent to with_cache(block, %{"type" => "ephemeral"}).
Annotates this block with a caller-supplied cache_control map.
Atom keys are accepted; they are stringified when serialized.