increase timeout for bing ai

This commit is contained in:
hibobmaster 2023-03-14 09:49:21 +08:00
parent 774038581f
commit 7314517b6a
Signed by: bobmaster
GPG key ID: 316B77D7914D713C
2 changed files with 3 additions and 2 deletions

View file

@ -32,7 +32,8 @@ If not set:<br>
"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:

2
bot.py
View file

@ -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"