Build the shared `reqwest::Client` for streaming LLM responses. Keeps a long total ceiling so multi-minute completions can finish, but still bounds connect + per-read so dead connections fail fast.
()
| 44 | /// Keeps a long total ceiling so multi-minute completions can finish, |
| 45 | /// but still bounds connect + per-read so dead connections fail fast. |
| 46 | pub fn streaming_client() -> AppResult<Client> { |
| 47 | Client::builder() |
| 48 | .user_agent(USER_AGENT) |
| 49 | .connect_timeout(CONNECT_TIMEOUT) |
| 50 | .read_timeout(STREAM_READ_TIMEOUT) |
| 51 | .timeout(STREAMING_TIMEOUT) |
| 52 | .build() |
| 53 | .map_err(|e| AppError::Internal(format!("Failed to build streaming HTTP client: {e}"))) |
| 54 | } |
| 55 | |
| 56 | /// Build the shared `reqwest::Client` for short, non-streaming requests |
| 57 | /// (listing models, generating titles, single-shot completions). |
no outgoing calls