cayu.providers.cache
Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.
CacheBreakpoint
Section titled “CacheBreakpoint”from cayu.providers import CacheBreakpointBases: StrEnum.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
SYSTEM_PROMPT |
class attribute |
'system_prompt' |
TOOL_DEFINITIONS |
class attribute |
'tool_definitions' |
CONVERSATION_PREFIX |
class attribute |
'conversation_prefix' |
Release source · Runtime guarantees · Capability guides
CachePolicy
Section titled “CachePolicy”from cayu.providers import CachePolicyControls prompt cache_control marker placement for the Anthropic provider.
A breakpoint marks the end of a stable, cacheable prefix. The default caches the system prompt and tool definitions, the two blocks that stay constant across the turns of a session. The model and marker format are Anthropic-Messages-shaped, so a future Bedrock/Vertex provider can reuse this policy when it lands.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
breakpoints |
tuple[CacheBreakpoint, ...] |
(CacheBreakpoint.SYSTEM_PROMPT, CacheBreakpoint.TOOL_DEFINITIONS) |
conversation_prefix_strategy |
Literal['all_but_last', 'all_but_last_n', 'none'] |
'all_but_last' |
conversation_prefix_n |
StrictInt |
Field(default=1, ge=1) |
ttl |
Literal['standard', 'extended'] | None |
None |
uses_extended_ttl (property)
Section titled “uses_extended_ttl (property)”CachePolicy.uses_extended_ttl() -> boolmarker (method)
Section titled “marker (method)”CachePolicy.marker() -> dict[str, str]Release source · Runtime guarantees · Capability guides
RequestCacheProjection
Section titled “RequestCacheProjection”from cayu.providers import RequestCacheProjectionEphemeral provider-owned cache evidence for one prepared request.
conversation_prefix contains only the projected message material through
the marker the adapter actually applied. The runtime may fingerprint this
value, but it never persists the value itself.
Bases: BaseModel.
Fields and attributes
Section titled “Fields and attributes”Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.
| Name | Type | Default |
|---|---|---|
policy |
CachePolicy |
required |
conversation_prefix |
tuple[dict[str, Any], ...] | None |
None |
copy_conversation_prefix (method)
Section titled “copy_conversation_prefix (method)”RequestCacheProjection.copy_conversation_prefix(value: object) -> objectvalidate_conversation_prefix (method)
Section titled “validate_conversation_prefix (method)”RequestCacheProjection.validate_conversation_prefix() -> RequestCacheProjection