Skip to content

Commit

Permalink
fix: jailbreak not on by default (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luisotee authored Nov 19, 2023
1 parent a740071 commit bcd11d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/handlers/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async function generateCompletionFor(

if (conversation) {
// If the conversation already exists
if (waChat?.jailbroken)
if (waChat?.jailbroken) {
// If the conversation is jailbroken
completion = await bing.sendMessage(message.body, {
jailbreakConversationId: conversation.jailbreakId as string,
Expand All @@ -125,6 +125,7 @@ async function generateCompletionFor(
context,
onProgress,
});
}
// If the conversation is not jailbroken
else
completion = await bing.sendMessage(message.body, {
Expand All @@ -141,7 +142,7 @@ async function generateCompletionFor(
} else {
// If the conversation doesn't exist yet
completion = await bing.sendMessage(message.body, {
jailbreakConversationId: waChat?.jailbroken ? true : undefined,
jailbreakConversationId: waChat?.jailbroken !== false,
systemMessage: waChat?.jailbroken ? SYSTEM_MESSAGE : undefined,
imageBase64,
toneStyle: BING_TONESTYLE,
Expand Down
3 changes: 0 additions & 3 deletions src/handlers/message/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import {
ENABLE_REMINDERS,
ENABLE_SOURCES,
ENABLE_SUGGESTIONS,
REPLY_TRANSCRIPTION,
TRANSCRIPTION_ENABLED,
} from "../../constants";
import { handleReminderFor } from "../reminder/reminder.ts";
import { updateWaMessageId } from "../../crud/conversation";
import { handleAudioMessage } from "../audio-message/index.ts";

export async function handleMessage(message: Message) {
await log(message);
Expand Down

0 comments on commit bcd11d3

Please sign in to comment.