diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-19 18:48:32 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-19 18:48:32 +0100 |
commit | 486e43dabd1198e6f3c94a4040fc01f5b2fe824c (patch) | |
tree | d328bf845d35e875c3c10964ac3b44d047ac352c /g4f/Provider/bing/conversation.py | |
parent | Fix abort in webview (diff) | |
download | gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar.gz gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar.bz2 gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar.lz gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar.xz gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.tar.zst gpt4free-486e43dabd1198e6f3c94a4040fc01f5b2fe824c.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/bing/conversation.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/g4f/Provider/bing/conversation.py b/g4f/Provider/bing/conversation.py index 886efa68..de5716b7 100644 --- a/g4f/Provider/bing/conversation.py +++ b/g4f/Provider/bing/conversation.py @@ -2,6 +2,7 @@ from __future__ import annotations from aiohttp import ClientSession from ...requests import raise_for_status +from ...errors import RateLimitError class Conversation: """ @@ -36,6 +37,8 @@ async def create_conversation(session: ClientSession, headers: dict, tone: str) else: url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1626.1" async with session.get(url, headers=headers) as response: + if response.status == 404: + raise RateLimitError("Response 404: Do less requests and reuse conversations") await raise_for_status(response, "Failed to create conversation") data = await response.json() conversationId = data.get('conversationId') |