新增API密钥切换日志,记录密钥切换信息

This commit is contained in:
yinpeng
2024-12-16 19:27:40 +08:00
parent 6136d3ac83
commit 09c2993210

View File

@@ -230,6 +230,7 @@ class ChatService:
logger.warning(f"Stream error: {str(e)}, attempting retry {retries + 1}")
if retries < MAX_RETRIES - 1:
current_api_key = await self.key_manager.handle_api_failure(current_api_key)
logger.info(f"Switched to new API key: {current_api_key}")
retries += 1
continue
else: