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