summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing/conversation.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-13 15:52:52 +0100
committerGitHub <noreply@github.com>2024-01-13 15:52:52 +0100
commitd632190f1d9ff04759a427d1938c0813e918e5e8 (patch)
tree44e3827128489f13fd6fbe7d18171d81176abc86 /g4f/Provider/bing/conversation.py
parentCleanup unused dependencies (diff)
parentMerge pull request #1462 from hlohaus/img (diff)
downloadgpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar.gz
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar.bz2
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar.lz
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar.xz
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.tar.zst
gpt4free-d632190f1d9ff04759a427d1938c0813e918e5e8.zip
Diffstat (limited to 'g4f/Provider/bing/conversation.py')
-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,