1use stakpak_shared::models::integrations::openai::AgentModel;
9use stakpak_shared::models::llm::LLMModel;
10
11pub(crate) mod context_managers;
13pub mod hooks;
14pub mod storage;
15
16#[cfg(test)]
17mod tests;
18
19#[derive(Clone, Debug, Default)]
21pub struct ModelOptions {
22 pub smart_model: Option<LLMModel>,
23 pub eco_model: Option<LLMModel>,
24 pub recovery_model: Option<LLMModel>,
25}
26
27#[derive(Clone, Debug)]
29pub struct ModelSet {
30 pub smart_model: LLMModel,
31 pub eco_model: LLMModel,
32 pub recovery_model: LLMModel,
33}
34
35impl ModelSet {
36 pub fn get_model(&self, agent_model: &AgentModel) -> LLMModel {
38 match agent_model {
39 AgentModel::Smart => self.smart_model.clone(),
40 AgentModel::Eco => self.eco_model.clone(),
41 AgentModel::Recovery => self.recovery_model.clone(),
42 }
43 }
44}
45
46impl From<ModelOptions> for ModelSet {
47 fn from(value: ModelOptions) -> Self {
48 let smart_model = value
50 .smart_model
51 .unwrap_or_else(|| LLMModel::from("stakpak/anthropic/claude-opus-4-5".to_string()));
52 let eco_model = value
53 .eco_model
54 .unwrap_or_else(|| LLMModel::from("stakpak/anthropic/claude-haiku-4-5".to_string()));
55 let recovery_model = value
56 .recovery_model
57 .unwrap_or_else(|| LLMModel::from("stakpak/openai/gpt-4o".to_string()));
58
59 Self {
60 smart_model,
61 eco_model,
62 recovery_model,
63 }
64 }
65}