| 164 | /// Production-grade LLM client with resilience patterns |
| 165 | #[pyclass] |
| 166 | pub struct LlmClient { |
| 167 | provider: Arc<RwLock<Box<dyn LlmProviderTrait>>>, |
| 168 | circuit_breaker: Arc<CircuitBreaker>, |
| 169 | config: ClientConfig, |
| 170 | stats: Arc<RwLock<ClientStats>>, |
| 171 | created_at: Instant, |
| 172 | /// Cache for warmup to avoid repeated initialization overhead |
| 173 | warmed_up: Arc<tokio::sync::OnceCell<()>>, |
| 174 | } |
| 175 | |
| 176 | #[pymethods] |
| 177 | impl LlmClient { |
no outgoing calls