diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-16 18:07:53 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-03-16 18:07:53 +0100 |
commit | 4778356064a005f0dec78a8fef40a26289217d7c (patch) | |
tree | d1835ab078e6a028c94b212d8f7530f1a78cc66f /g4f/Provider/bing/conversation.py | |
parent | Add copilot conversation mode (diff) | |
download | gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar.gz gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar.bz2 gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar.lz gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar.xz gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.tar.zst gpt4free-4778356064a005f0dec78a8fef40a26289217d7c.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/Provider/bing/conversation.py | 7 |
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() |