This commit is contained in:
abc 2023-10-06 12:21:42 +01:00
parent a4b5f5a6fd
commit c8835b15d4
2 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View File

@ -37,5 +37,7 @@ close_issues.py
xxx.py
lab.py
lab.js
bing.py
bing2.py
# Emacs crap
*~

View File

@ -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]