2.1 #2

Merged
rune merged 10 commits from 2.1 into main 2026-02-03 09:02:44 +01:00
Showing only changes of commit 2c9f33868e - Show all commits

9
oai.py
View File

@@ -5034,6 +5034,15 @@ All queries are read-only. INSERT/UPDATE/DELETE are not allowed."""
try:
if hasattr(response, 'close'):
response.close()
elif hasattr(response, '__exit__'):
response.__exit__(None, None, None)
except:
pass
# Recreate client to be safe
try:
client = OpenRouter(api_key=API_KEY)
app_logger.info("Client recreated after stream interruption")
except:
pass