Skip to repository content

tenant.openagents/omega

No repository description is available.

OpenAgents Git authority 2026-07-28T01:50:59.181Z Public web read
NIP-34 coordinate30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omega
MaintainersHidden in public view
References2 branches · 1 tag
Read-only clonegit clone https://openagents.com/git/tenant.openagents/omega.git
Browse files

distill.rs

37 lines · 968 B · rust
1use anyhow::Result;
2
3use crate::{PredictionProvider, example::Example};
4
5pub async fn run_distill(example: &mut Example) -> Result<()> {
6    let has_repair = example
7        .predictions
8        .iter()
9        .find(|p| p.provider == PredictionProvider::Repair);
10    let predictions = if let Some(has_repair) = has_repair {
11        vec![has_repair]
12    } else {
13        example.predictions.iter().collect()
14    };
15
16    let expected_patches = predictions
17        .into_iter()
18        .filter_map(|p| {
19            Some((
20                p.actual_patch.clone()?,
21                p.actual_cursor
22                    .as_ref()
23                    .and_then(|c| c.editable_region_offset),
24            ))
25        })
26        .collect();
27
28    example
29        .spec
30        .set_expected_patches_with_cursor_positions(expected_patches);
31    example.prompt = None;
32    example.predictions = Vec::new();
33    example.score = Vec::new();
34    example.qa = Vec::new();
35    Ok(())
36}
37
Served at tenant.openagents/omega Member data and write actions are omitted.