From ea8d6b847a0e656cc5583948c5745592adda7103 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 13 Jan 2024 15:37:36 +0100 Subject: Support upload image in gui Add image upload to OpenaiChat Add image response to OpenaiChat Improve ChatGPT Plus Support Remove unused requirements --- g4f/Provider/bing/conversation.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'g4f/Provider/bing/conversation.py') 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, -- cgit v1.2.3