1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! LLM configuration trait for provider-agnostic agent building.
//!
//! This module defines the [`LlmConfigLike`] trait that allows any configuration
//! struct to be used with the agent factory functions. This decouples sac from
//! specific configuration crate dependencies.
//!
//! # Example
//!
//! ```rust,ignore
//! use sombrax_agentic_core::providers::{LlmConfigLike, build_agent};
//!
//! struct MyConfig {
//! provider: String,
//! url: String,
//! model: String,
//! api_key: Option<String>,
//! }
//!
//! impl LlmConfigLike for MyConfig {
//! fn provider(&self) -> &str { &self.provider }
//! fn url(&self) -> &str { &self.url }
//! fn model(&self) -> &str { &self.model }
//! fn api_key(&self) -> Option<&str> { self.api_key.as_deref() }
//! }
//!
//! let config = MyConfig { /* ... */ };
//! let agent = build_agent(&config, "system prompt", 8192, vec![]).await?;
//! ```
/// Configuration trait for LLM providers.
///
/// Implement this trait for your configuration struct to use the factory functions.
/// This allows `sac` to remain independent of specific config crate dependencies.
///
/// Required methods provide the essential fields for all providers.
/// Optional methods have default implementations returning `None` and are used
/// by specific providers that support additional features.