use async_trait::async_trait;
use super::optimizer::OptimizerError;
use crate::evaluation::EvalCase;
#[derive(Debug, Clone)]
pub struct EvalSample {
pub cases: Vec<EvalCase>,
pub case_ids: Vec<String>,
}
#[async_trait]
pub trait Sampler: Send + Sync {
async fn sample_training(&self, batch_size: usize) -> Result<EvalSample, OptimizerError>;
async fn validation_set(&self) -> Result<EvalSample, OptimizerError>;
async fn score(
&self,
instruction: &str,
model_id: &str,
cases: &[EvalCase],
) -> Result<f64, OptimizerError>;
}
#[cfg(test)]
mod tests {
use super::*;
fn _assert_object_safe(_: &dyn Sampler) {}
}