summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing/conversation.py
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 15:37:36 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-01-13 15:37:36 +0100
commitea8d6b847a0e656cc5583948c5745592adda7103 (patch)
treecb796ff258d339a5ee4a4ec3fb4b2617e6639677 /g4f/Provider/bing/conversation.py
parentChange pypi to live (diff)
downloadgpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar.gz
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar.bz2
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar.lz
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar.xz
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.tar.zst
gpt4free-ea8d6b847a0e656cc5583948c5745592adda7103.zip
Diffstat (limited to '')
-rw-r--r--g4f/Provider/bing/conversation.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/g4f/Provider/bing/conversation.py b/g4f/Provider/bing/conversation.py
index ef45cd82..9e011c26 100644
--- a/g4f/Provider/bing/conversation.py
+++ b/g4f/Provider/bing/conversation.py
@@ -10,7 +10,10 @@ class Conversation():
async def create_conversation(session: ClientSession, proxy: str = None) -> Conversation:
url = 'https://www.bing.com/turing/conversation/create?bundleVersion=1.1199.4'
async with session.get(url, proxy=proxy) as response:
- data = await response.json()
+ try:
+ data = await response.json()
+ except:
+ raise RuntimeError(f"Response: {await response.text()}")
conversationId = data.get('conversationId')
clientId = data.get('clientId')
@@ -26,7 +29,7 @@ async def list_conversations(session: ClientSession) -> list:
response = await response.json()
return response["chats"]
-async def delete_conversation(session: ClientSession, conversation: Conversation, proxy: str = None) -> list:
+async def delete_conversation(session: ClientSession, conversation: Conversation, proxy: str = None) -> bool:
url = "https://sydney.bing.com/sydney/DeleteSingleConversation"
json = {
"conversationId": conversation.conversationId,