Skip to main content

to_parts

Function to_parts 

Source
pub fn to_parts(v: &mut Value, caches: bool)
Expand description

Converts an Anthropic-layout prompt to agentplane’s shared shape (for PromptStyle::Parts): system blocks and the first message’s content become text parts, a cache_control breakpoint a cache mark — "1h" for the hour, "5m" otherwise — or none when caches is off. A string system stays as it is; a prompt without messages is left untouched.