Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Add multiple jailbreak prompts alternatives that function. (βœ“ Sandbox Passed) #32

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions jailbreak_handlers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
async def handle_balakula_jailbreak(user_input: str) -> str:
gpt_response = user_input # Simulate GPT response
balakula_response = user_input # Simulate Balakula's unique response
return f"GPT: {gpt_response}\nBalakula: {balakula_response}"

async def handle_basedgpt_jailbreak(user_input: str) -> str:
return f"BasedGPT: {user_input}"

async def handle_dac_jailbreak(user_input: str) -> str:
return f"```DAC: {user_input}
26 changes: 26 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from telethon import TelegramClient
from jailbreak_handlers import handle_balakula_jailbreak, handle_basedgpt_jailbreak, handle_dac_jailbreak
from telethon.events import NewMessage
from dotenv import load_dotenv
from os import getenv
Expand Down Expand Up @@ -112,6 +113,18 @@ async def roles(event):
with open("roles.json", "r") as f:
roles = f.read()
roles = json.loads(roles)
elif jailbreak == 'Balakula':
global BALAKULA_JAILBREAK
BALAKULA_JAILBREAK = True
await event.respond('Balakula Mode enabled')
elif jailbreak == 'BasedGPT':
global BASEDGPT_JAILBREAK
BASEDGPT_JAILBREAK = True
await event.respond('BasedGPT Mode enabled')
elif jailbreak == 'DAC':
global DAC_JAILBREAK
DAC_JAILBREAK = True
await event.respond('DAC Mode enabled')
await event.respond("Available roles:\n{}".format("\n".join(roles.keys())))

@client.on(NewMessage(pattern="/role"))
Expand Down Expand Up @@ -190,6 +203,19 @@ async def handler(e):
PLUGINS = False
if MEMORY == True:
res = memory.find(prompt)
global BALAKULA_JAILBREAK, BASEDGPT_JAILBREAK, DAC_JAILBREAK
if BALAKULA_JAILBREAK:
response = await handle_balakula_jailbreak(prompt)
await msg.edit(response)
return
elif BASEDGPT_JAILBREAK:
response = await handle_basedgpt_jailbreak(prompt)
await msg.edit(response)
return
elif DAC_JAILBREAK:
response = await handle_dac_jailbreak(prompt)
await msg.edit(response)
return
if len(res) > 0 or res[0] != []:
system_prompt = system_prompt + "To answer the next question these data may be relevant: "
for i in res:
Expand Down