sim_lib_agent_runner_core/
card.rs1use sim_citizen_derive::Citizen;
2use sim_kernel::{Expr, Symbol};
3
4#[derive(Clone, Debug, PartialEq, Citizen)]
6#[citizen(symbol = "agent-runner/ModelCard", version = 1)]
7pub struct ModelCard {
8 pub runner: Symbol,
10 pub model: String,
12 pub provider: Symbol,
14 pub locality: Symbol,
16 pub extra: Vec<(Expr, Expr)>,
18}
19
20impl ModelCard {
21 pub fn new(
23 runner: Symbol,
24 model: impl Into<String>,
25 provider: Symbol,
26 locality: Symbol,
27 ) -> Self {
28 Self {
29 runner,
30 model: model.into(),
31 provider,
32 locality,
33 extra: Vec::new(),
34 }
35 }
36}
37
38impl Default for ModelCard {
39 fn default() -> Self {
40 Self::new(
41 Symbol::qualified("runner", "fixture"),
42 "fixture-model",
43 Symbol::new("fixture-provider"),
44 Symbol::new("local"),
45 )
46 }
47}
48
49#[derive(Clone, Debug, PartialEq, Default, Citizen)]
51#[citizen(symbol = "agent-runner/ModelBid", version = 1)]
52pub struct ModelBid {
53 pub available: bool,
55 pub reason: Option<String>,
57 pub score: Option<f64>,
59 pub model: Option<String>,
61 pub extra: Vec<(Expr, Expr)>,
63}
64
65impl ModelBid {
66 pub fn unavailable(reason: impl Into<String>) -> Self {
68 Self {
69 available: false,
70 reason: Some(reason.into()),
71 score: None,
72 model: None,
73 extra: Vec::new(),
74 }
75 }
76}
77
78pub fn model_card_class_symbol() -> Symbol {
80 Symbol::qualified("agent-runner", "ModelCard")
81}
82
83pub fn model_bid_class_symbol() -> Symbol {
85 Symbol::qualified("agent-runner", "ModelBid")
86}