File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 5252# Increase batch size for parallel processing
5353EMBEDDING_BATCH_SIZE = 16 # Process embeddings in batches for better throughput
5454PROGRESS_LOG_INTERVAL = 10 # Log progress every N completed files
55- EMBEDDING_TIMEOUT = 30 # Timeout in seconds for each embedding API call
55+ # Timeout for future.result() must account for retries: (max_retries + 1) × SDK_timeout + buffer
56+ # With SDK timeout of 15s and max_retries=2, this allows 3 × 15s = 45s + 15s buffer = 60s
57+ EMBEDDING_TIMEOUT = 60 # Timeout in seconds for each embedding API call (including retries)
5658FILE_PROCESSING_TIMEOUT = 300 # Timeout in seconds for processing a single file (5 minutes)
5759_THREADPOOL_WORKERS = max (16 , EMBEDDING_CONCURRENCY + 8 )
5860_EXECUTOR = concurrent .futures .ThreadPoolExecutor (max_workers = _THREADPOOL_WORKERS )
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ def __init__(self,
122122 api_url : Optional [str ] = None ,
123123 api_key : Optional [str ] = None ,
124124 model : Optional [str ] = None ,
125- timeout : float = 30 .0 ,
125+ timeout : float = 15 .0 ,
126126 max_retries : int = 2 ,
127127 backoff : float = 1.5 ):
128128 self .api_url = api_url or CFG .get ("api_url" )
You can’t perform that action at this time.
0 commit comments