summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing/conversation.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-01-13 15:48:38 +0100
committerGitHub <noreply@github.com>2024-01-13 15:48:38 +0100
commit467f2a6fc67e6c5a6cf996da961dc1f68bd7d456 (patch)
tree70d06c98503a235d8e6727a9ea4537fea4330f8c /g4f/Provider/bing/conversation.py
parent~ (diff)
parentSupport upload image in gui (diff)
downloadgpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.gz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.bz2
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.lz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.xz
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.tar.zst
gpt4free-467f2a6fc67e6c5a6cf996da961dc1f68bd7d456.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,