anthropic.internal._anth_apply_cache_control

(internal) Anthropic places a cache breakpoint on a CONTENT BLOCK, but the authored directive lives on a MESSAGE (`${ai.Role { name: "user", metadata: { "cache_control": ... } }}`). The engine's rule, ported: the directive attaches to that message's LAST content block, so everything up to and including it is the cached prefix.

Reference version

Signature

function anthropic.internal._anth_apply_cache_control(
cache_control: baml.json.json | null
) -> void

(internal) Anthropic places a cache breakpoint on a CONTENT BLOCK, but the authored directive lives on a MESSAGE (${ai.Role { name: "user", metadata: { "cache_control": ... } }}). The engine's rule, ported: the directive attaches to that message's LAST content block, so everything up to and including it is the cached prefix.

Source:<builtin>/anthropic/ns_internal/messages.bamlbytes 1019411052