From 7314517b6a84c93347e7abe6de41cbd04872c9b5 Mon Sep 17 00:00:00 2001 From: hibobmaster Date: Tue, 14 Mar 2023 09:49:21 +0800 Subject: [PATCH] increase timeout for bing ai --- README.md | 3 ++- bot.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 902c427..9e7a5aa 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ If not set:
"password": "YOUR_PASSWORD", "device_id": "YOUR_DEVICE_ID", "room_id": "YOUR_ROOM_ID", - "api_key": "YOUR_API_KEY" + "api_key": "YOUR_API_KEY", + "access_token": "xxxxxxxx" } ``` 4. Start the bot: diff --git a/bot.py b/bot.py index 3b68270..9ab6842 100644 --- a/bot.py +++ b/bot.py @@ -132,7 +132,7 @@ class Bot: prompt = b.group(1) try: # timeout 30s - text = await asyncio.wait_for(self.bingbot.ask_bing(prompt), timeout=30) + text = await asyncio.wait_for(self.bingbot.ask_bing(prompt), timeout=120) except TimeoutError: logger.error("timeoutException", exc_info=True) text = "Timeout error"