zed/crates/edit_prediction_cli/src/distill.rs
Oleksiy Syvokon 8e48a16193
Add ep parse-output command (#47220)
This command takes raw LLM outputs (`predictions.actual_output`) that
could be generated elsewhere and parses them into a canonical unified
diff (`predictions.actual_patch`).

This is useful for simplifying the evaluation pipeline and for rerunning
the parser without having to generate LLM outputs.

Release Notes:

- N/A
2026-01-20 17:12:58 +02:00

17 lines
428 B
Rust

use anyhow::Result;
use std::mem;
use crate::example::Example;
pub async fn run_distill(example: &mut Example) -> Result<()> {
let predictions = mem::take(&mut example.predictions)
.into_iter()
.filter_map(|p| p.actual_patch)
.collect();
example.spec.expected_patches = predictions;
example.prompt = None;
example.predictions = Vec::new();
example.score = Vec::new();
Ok(())
}