AION-Search / src /upstream.py
astronolan's picture
Validate callback state and bound upstream waits
980f681
Raw History Blame Contribute Delete
473 Bytes
"""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.")