Spaces:
Running
Running
File size: 942 Bytes
4c40bac | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | import os
from typing import List
from dotenv import load_dotenv
load_dotenv()
def get_api_keys() -> List[str]:
keys_str = os.getenv("OPENROUTER_API_KEYS", "")
if not keys_str:
raise ValueError("OPENROUTER_API_KEYS environment variable is not set")
keys = [k.strip() for k in keys_str.split(",") if k.strip()]
if not keys:
raise ValueError("No valid API keys found in OPENROUTER_API_KEYS")
return keys
def get_scan_interval_hours() -> float:
return float(os.getenv("SCAN_INTERVAL_HOURS", "1"))
def get_max_retries() -> int:
return int(os.getenv("MAX_RETRIES", "3"))
def get_retry_delay() -> int:
return int(os.getenv("RETRY_DELAY", "5"))
def get_request_timeout() -> int:
return int(os.getenv("REQUEST_TIMEOUT", "30"))
def get_max_concurrency() -> int:
return int(os.getenv("MAX_CONCURRENCY", "5"))
def get_test_prompt() -> str:
return os.getenv("TEST_PROMPT", "hi")
|