Spaces:
Running
Running
Download src/upstream.py from astronolan/AION-Search: direct link, hf CLI and curl.
- Browser
- Download file 473 Bytes
-
https://huggingface.co/spaces/astronolan/AION-Search/resolve/main/src/upstream.py
- Command line
-
hf download hf://spaces/astronolan/AION-Search/src/upstream.py
-
curl -L -o upstream.py https://huggingface.co/spaces/astronolan/AION-Search/resolve/main/src/upstream.py
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.") | |