Spaces:
Running
Running
fix: align non-stream provider fallback timeout
Browse files- models/ai_client.py +4 -1
models/ai_client.py
CHANGED
|
@@ -172,7 +172,10 @@ class AIClient:
|
|
| 172 |
temperature=temperature,
|
| 173 |
max_tokens=max_tokens
|
| 174 |
),
|
| 175 |
-
|
|
|
|
|
|
|
|
|
|
| 176 |
)
|
| 177 |
return provider, response.choices[0].message.content or "", _time_mod.monotonic() - start
|
| 178 |
except Exception as e:
|
|
|
|
| 172 |
temperature=temperature,
|
| 173 |
max_tokens=max_tokens
|
| 174 |
),
|
| 175 |
+
# Il fallback non-streaming deve avere lo stesso budget del client:
|
| 176 |
+
# 15s scartava provider sani su richieste coding che richiedono
|
| 177 |
+
# più tempo per produrre una risposta completa dopo uno stream interrotto.
|
| 178 |
+
timeout=45
|
| 179 |
)
|
| 180 |
return provider, response.choices[0].message.content or "", _time_mod.monotonic() - start
|
| 181 |
except Exception as e:
|