How to make Sydney jailbreak support context conversations #174
-
The second request return InvalidSession import aiohttp
import time
import json
import asyncio
api_endpoint = "http://localhost:3000/conversation"
class BingBot:
def __init__(self):
self.data = {}
async def ask_bing(self, prompt) -> str:
self.data['message'] = prompt
self.data['jailbreakConversationId'] = True
async with aiohttp.ClientSession() as session:
max_try = 5
while max_try > 0:
try:
resp = await session.post(url=api_endpoint, json=self.data)
status_code = resp.status
body = await resp.read()
if not status_code == 200:
max_try = max_try - 1
# print(await resp.text())
time.sleep(2)
continue
json_body = json.loads(body)
self.data['conversationId'] = json_body['conversationId']
self.data['conversationSignature'] = json_body['conversationSignature']
self.data['clientId'] = json_body['clientId']
self.data['invocationId'] = json_body['invocationId']
return json_body['response']
except Exception as e:
print(f"Error: {e}")
pass
return "Error, please retry"
async def test():
bingbot = BingBot()
prompt1 = "Hello World"
prompt2 = "Do you know Victor Marie Hugo"
resp1 = await bingbot.ask_bing(prompt1)
resp2 = await bingbot.ask_bing(prompt2)
print(resp1)
print(resp2)
if __name__ == "__main__":
asyncio.run(test()) If i remove - self.data['invocationId'] = json_body['invocationId'] The jailbreak prompt is calling again. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Take a look at https://github.com/waylaidwanderer/node-chatgpt-api/blob/main/demos/use-bing-client.js#L74-L75. When using jailbreak mode, after you set |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Solved with:
59a7443
f14b23b
Thanks for your great work!