Skip to main content

trim_count

Function trim_count 

Source
pub fn trim_count<T: Clone>(items: Vec<T>, strategy: &ContextStrategy) -> Vec<T>
Expand description

Apply a ContextStrategy to any cloneable list, trimming by count/position.

This is the typed counterpart to apply_strategy — useful when messages are already strongly typed (e.g. Vec<crate::llm::Message>) and you want to avoid round-tripping through serde_json::Value.