Добавлен таймаут запросов к ИИ.

This commit is contained in:
Kirill Kirilenko 2025-12-31 04:54:16 +03:00
parent ab31d03464
commit 24ce709fb1

View file

@ -39,7 +39,7 @@ class AiMessage:
class AiAgent: class AiAgent:
def __init__(self, api_token: str): def __init__(self, api_token: str):
self.client = OpenRouter(api_key=api_token) self.client = OpenRouter(api_key=api_token, timeout_ms=15000)
self.chat_contexts: Dict[int, ChatContext] = {} self.chat_contexts: Dict[int, ChatContext] = {}
async def get_reply(self, chat_id: int, chat_prompt: str, async def get_reply(self, chat_id: int, chat_prompt: str,