anthropic.internal._prompt_blocks
(internal) One prompt message as Messages API blocks. Text and media lower exactly as they do for a journal turn; a `${cache(args)}` sets `cache_control` on the block before it (`_anth_apply_cache_control`), and the text on either side is trimmed where it faces the delimiter (`ai.wire.prompt_parts`). A `${cache()}` carries `default_cache_args`.
Reference version
Signature
function anthropic.internal._prompt_blocks(
message: ai.PromptMessage,
position: string,
default_cache_args: baml.json.json,
preview: bool = …
) -> anthropic.internal.AnthBlock[] throws baml.errors.InvalidArgument | baml.errors.Timeout | ai.errors.InvalidRequest | ai.errors.NetworkFailure | ai.errors.PreviewUnsupported
(internal) One prompt message as Messages API blocks. Text and media lower
exactly as they do for a journal turn; a ${cache(args)} sets
cache_control on the block before it (_anth_apply_cache_control), and
the text on either side is trimmed where it faces the delimiter
(ai.wire.prompt_parts). A ${cache()} carries default_cache_args.
Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 16309–17428