Skip to main content

distill_strategy

Function distill_strategy 

Source
pub async fn distill_strategy(
    provider: &AnyProvider,
    outcome: Outcome,
    reasoning_chain: &str,
    distill_timeout: Duration,
) -> Option<String>
Expand description

Run the distillation step.

Sends the reasoning chain and outcome label to the LLM and trims the response to at most 3 sentences and 512 characters.

Returns None on LLM error, timeout, or empty response.

ยงExamples

use std::time::Duration;
use zeph_llm::any::AnyProvider;
use zeph_memory::reasoning::{Outcome, distill_strategy};

async fn demo(provider: AnyProvider) {
    let summary = distill_strategy(&provider, Outcome::Success, "tried X, worked", Duration::from_secs(10)).await;
    println!("{:?}", summary);
}