Core execution method with full resilience patterns
(
provider: Arc<RwLock<Box<dyn LlmProviderTrait>>>,
circuit_breaker: Arc<CircuitBreaker>,
stats: Arc<RwLock<ClientStats>>,
config: ClientConfig,
prompt: String,
| 957 | impl LlmClient { |
| 958 | /// Core execution method with full resilience patterns |
| 959 | async fn execute_with_resilience( |
| 960 | provider: Arc<RwLock<Box<dyn LlmProviderTrait>>>, |
| 961 | circuit_breaker: Arc<CircuitBreaker>, |
| 962 | stats: Arc<RwLock<ClientStats>>, |
| 963 | config: ClientConfig, |
| 964 | prompt: String, |
| 965 | max_tokens: Option<u32>, |
| 966 | temperature: Option<f32>, |
| 967 | enable_prompt_caching: bool, |
| 968 | ) -> PyResult<String> { |
| 969 | let mut request = LlmRequest::new(prompt); |
| 970 | if let Some(tokens) = max_tokens { |
| 971 | request = request.with_max_tokens(tokens); |
| 972 | } |
| 973 | if let Some(temp) = temperature { |
| 974 | request = request.with_temperature(temp); |
| 975 | } |
| 976 | if enable_prompt_caching { |
| 977 | request = request.with_prompt_caching(true); |
| 978 | } |
| 979 | |
| 980 | let response = Self::execute_request_with_resilience( |
| 981 | provider, |
| 982 | circuit_breaker, |
| 983 | stats, |
| 984 | config, |
| 985 | request, |
| 986 | ) |
| 987 | .await?; |
| 988 | |
| 989 | Ok(response.content) |
| 990 | } |
| 991 | |
| 992 | /// Core execution method with full resilience patterns (returns full response) |
| 993 | async fn execute_with_resilience_full( |
nothing calls this directly
no test coverage detected