use sim_citizen_derive::Citizen;
use sim_kernel::{Expr, Symbol};
#[derive(Clone, Debug, PartialEq, Citizen)]
#[citizen(symbol = "agent-runner/ModelCard", version = 1)]
pub struct ModelCard {
pub runner: Symbol,
pub model: String,
pub provider: Symbol,
pub locality: Symbol,
pub extra: Vec<(Expr, Expr)>,
}
impl ModelCard {
pub fn new(
runner: Symbol,
model: impl Into<String>,
provider: Symbol,
locality: Symbol,
) -> Self {
Self {
runner,
model: model.into(),
provider,
locality,
extra: Vec::new(),
}
}
}
impl Default for ModelCard {
fn default() -> Self {
Self::new(
Symbol::qualified("runner", "fixture"),
"fixture-model",
Symbol::new("fixture-provider"),
Symbol::new("local"),
)
}
}
#[derive(Clone, Debug, PartialEq, Default, Citizen)]
#[citizen(symbol = "agent-runner/ModelBid", version = 1)]
pub struct ModelBid {
pub available: bool,
pub reason: Option<String>,
pub score: Option<f64>,
pub model: Option<String>,
pub extra: Vec<(Expr, Expr)>,
}
impl ModelBid {
pub fn unavailable(reason: impl Into<String>) -> Self {
Self {
available: false,
reason: Some(reason.into()),
score: None,
model: None,
extra: Vec::new(),
}
}
}
pub fn model_card_class_symbol() -> Symbol {
Symbol::qualified("agent-runner", "ModelCard")
}
pub fn model_bid_class_symbol() -> Symbol {
Symbol::qualified("agent-runner", "ModelBid")
}