MCPcopy Create free account
hub / github.com/InfinitiBit/graphbit / execute_with_resilience_full

Method execute_with_resilience_full

python/src/llm/client.rs:993–1016  ·  view source on GitHub ↗

Core execution method with full resilience patterns (returns full response)

(
        provider: Arc<RwLock<Box<dyn LlmProviderTrait>>>,
        circuit_breaker: Arc<CircuitBreaker>,
        stats: Arc<RwLock<ClientStats>>,
        config: ClientConfig,
        prompt: String,

Source from the content-addressed store, hash-verified

991
992 /// Core execution method with full resilience patterns (returns full response)
993 async fn execute_with_resilience_full(
994 provider: Arc<RwLock<Box<dyn LlmProviderTrait>>>,
995 circuit_breaker: Arc<CircuitBreaker>,
996 stats: Arc<RwLock<ClientStats>>,
997 config: ClientConfig,
998 prompt: String,
999 max_tokens: Option<u32>,
1000 temperature: Option<f32>,
1001 enable_prompt_caching: bool,
1002 ) -> PyResult<graphbit_core::llm::LlmResponse> {
1003 let mut request = LlmRequest::new(prompt);
1004 if let Some(tokens) = max_tokens {
1005 request = request.with_max_tokens(tokens);
1006 }
1007 if let Some(temp) = temperature {
1008 request = request.with_temperature(temp);
1009 }
1010 if enable_prompt_caching {
1011 request = request.with_prompt_caching(true);
1012 }
1013
1014 Self::execute_request_with_resilience(provider, circuit_breaker, stats, config, request)
1015 .await
1016 }
1017
1018 /// Execute a single request with retry logic and circuit breaker
1019 async fn execute_request_with_resilience(

Callers

nothing calls this directly

Calls 3

with_prompt_cachingMethod · 0.80
with_max_tokensMethod · 0.45
with_temperatureMethod · 0.45

Tested by

no test coverage detected