ai_lib/client/
model_options.rs1#[derive(Debug, Clone)]
3pub struct ModelOptions {
4 pub chat_model: Option<String>,
5 pub multimodal_model: Option<String>,
6 pub fallback_models: Vec<String>,
7 pub auto_discovery: bool,
8}
9
10impl Default for ModelOptions {
11 fn default() -> Self {
12 Self {
13 chat_model: None,
14 multimodal_model: None,
15 fallback_models: Vec::new(),
16 auto_discovery: true,
17 }
18 }
19}
20
21impl ModelOptions {
22 pub fn new() -> Self {
24 Self::default()
25 }
26
27 pub fn with_chat_model(mut self, model: &str) -> Self {
29 self.chat_model = Some(model.to_string());
30 self
31 }
32
33 pub fn with_multimodal_model(mut self, model: &str) -> Self {
35 self.multimodal_model = Some(model.to_string());
36 self
37 }
38
39 pub fn with_fallback_models(mut self, models: Vec<&str>) -> Self {
41 self.fallback_models = models.into_iter().map(|s| s.to_string()).collect();
42 self
43 }
44
45 pub fn with_auto_discovery(mut self, enabled: bool) -> Self {
47 self.auto_discovery = enabled;
48 self
49 }
50}