Skip to main content

apply_strategy

Function apply_strategy 

Source
pub fn apply_strategy(
    messages: &[Value],
    strategy: &ContextStrategy,
) -> Vec<Value>
Expand description

Apply a ContextStrategy to a message list and return the filtered list.

Messages are serde_json::Value objects with at minimum a "role" and "content" field (OpenAI chat format).