summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorabc <98614666+xtekky@users.noreply.github.com>2023-10-06 13:21:42 +0200
committerabc <98614666+xtekky@users.noreply.github.com>2023-10-06 13:21:42 +0200
commitc8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8 (patch)
tree311416828a5a4ec7a49df51fa72d6a238ee45e3f
parent~ | fix gpt-3.5-turbo models (diff)
downloadgpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar.gz
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar.bz2
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar.lz
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar.xz
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.tar.zst
gpt4free-c8835b15d4bda70fb9530d2cf8f4dbd75eaf3cd8.zip
Diffstat (limited to '')
-rw-r--r--.gitignore2
-rw-r--r--g4f/Provider/Bing.py6
2 files changed, 6 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index 6ecf36f1..96c68324 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,5 +37,7 @@ close_issues.py
xxx.py
lab.py
lab.js
+bing.py
+bing2.py
# Emacs crap
*~ \ No newline at end of file
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index b669d800..aa2db990 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -60,9 +60,11 @@ class Conversation():
self.conversationSignature = conversationSignature
async def create_conversation(session: ClientSession) -> Conversation:
- url = 'https://www.bing.com/turing/conversation/create'
+ url = 'https://www.bing.com/turing/conversation/create?bundleVersion=1.1150.3'
+
async with await session.get(url) as response:
data = await response.json()
+
conversationId = data.get('conversationId')
clientId = data.get('clientId')
conversationSignature = response.headers.get('X-Sydney-Encryptedconversationsignature')
@@ -267,7 +269,7 @@ async def stream_generate(
for obj in objects:
if obj is None or not obj:
continue
-
+
response = json.loads(obj)
if response.get('type') == 1 and response['arguments'][0].get('messages'):
message = response['arguments'][0]['messages'][0]