File size: 473 Bytes
980f681
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""Explicit upstream connection/read timeouts and retry policy."""

import httpx

CONNECT_TIMEOUT_SECONDS = 5.0
READ_TIMEOUT_SECONDS = 60.0
ZILLIZ_TIMEOUT = (CONNECT_TIMEOUT_SECONDS, READ_TIMEOUT_SECONDS)
OPENAI_TIMEOUT = httpx.Timeout(READ_TIMEOUT_SECONDS, connect=CONNECT_TIMEOUT_SECONDS)
OPENAI_MAX_RETRIES = 1


class UpstreamTimeoutError(RuntimeError):
    def __init__(self):
        super().__init__("The search service took too long to respond. Please try again.")