Expand description
Timeout middleware — enforces a per-call time limit on LLM completions.
Wraps each complete() call with tokio::time::timeout. If the call
exceeds the deadline, returns PeError::Timeout.
§Example
ⓘ
use std::time::Duration;
use pe_core::timeout_middleware::TimeoutMiddleware;
let timeout = TimeoutMiddleware::new(Duration::from_secs(30));
let stack = MiddlewareStack::new(provider).with(timeout);Structs§
- Timeout
Middleware - Enforces a per-call time limit on LLM completion requests.