summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/bing/conversation.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-16 18:22:26 +0100
committerGitHub <noreply@github.com>2024-03-16 18:22:26 +0100
commitfb2061da48525edab9cd993205bb5e30c386aa1a (patch)
tree1e740bd6955dfd27b9a4d773df07234ed9e5c75e /g4f/Provider/bing/conversation.py
parentMerge pull request #1694 from ComRSMaster/main (diff)
parentAdd conversation support for Bing (diff)
downloadgpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.gz
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.bz2
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.lz
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.xz
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.tar.zst
gpt4free-fb2061da48525edab9cd993205bb5e30c386aa1a.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 da842808..886efa68 100644
--- a/g4f/Provider/bing/conversation.py
+++ b/g4f/Provider/bing/conversation.py
@@ -20,7 +20,7 @@ class Conversation:
self.clientId = clientId
self.conversationSignature = conversationSignature
-async def create_conversation(session: ClientSession, headers: dict) -> Conversation:
+async def create_conversation(session: ClientSession, headers: dict, tone: str) -> Conversation:
"""
Create a new conversation asynchronously.
@@ -31,7 +31,10 @@ async def create_conversation(session: ClientSession, headers: dict) -> Conversa
Returns:
Conversation: An instance representing the created conversation.
"""
- url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1626.1"
+ if tone == "copilot":
+ url = "https://copilot.microsoft.com/turing/conversation/create?bundleVersion=1.1634.3-nodesign2"
+ else:
+ url = "https://www.bing.com/turing/conversation/create?bundleVersion=1.1626.1"
async with session.get(url, headers=headers) as response:
await raise_for_status(response, "Failed to create conversation")
data = await response.json()