@@ -20,6 +20,11 @@ export async function generateAnswersWithBingWebApi(
20
20
const config = await getUserConfig ( )
21
21
22
22
const bingAIClient = new BingAIClient ( { userToken : accessToken } )
23
+ if ( session . bingWeb_jailbreakConversationCache )
24
+ bingAIClient . conversationsCache . set (
25
+ session . bingWeb_jailbreakConversationId ,
26
+ session . bingWeb_jailbreakConversationCache ,
27
+ )
23
28
24
29
let answer = ''
25
30
const response = await bingAIClient
@@ -40,17 +45,30 @@ export async function generateAnswersWithBingWebApi(
40
45
clientId : session . bingWeb_clientId ,
41
46
invocationId : session . bingWeb_invocationId ,
42
47
}
48
+ : session . bingWeb_jailbreakConversationId
49
+ ? {
50
+ jailbreakConversationId : session . bingWeb_jailbreakConversationId ,
51
+ parentMessageId : session . bingWeb_parentMessageId ,
52
+ }
43
53
: { } ) ,
44
54
} )
45
55
. catch ( ( err ) => {
46
56
port . onMessage . removeListener ( messageListener )
47
57
throw err
48
58
} )
49
59
50
- session . bingWeb_conversationSignature = response . conversationSignature
51
- session . bingWeb_conversationId = response . conversationId
52
- session . bingWeb_clientId = response . clientId
53
- session . bingWeb_invocationId = response . invocationId
60
+ if ( ! sydneyMode ) {
61
+ session . bingWeb_conversationSignature = response . conversationSignature
62
+ session . bingWeb_conversationId = response . conversationId
63
+ session . bingWeb_clientId = response . clientId
64
+ session . bingWeb_invocationId = response . invocationId
65
+ } else {
66
+ session . bingWeb_jailbreakConversationId = response . jailbreakConversationId
67
+ session . bingWeb_parentMessageId = response . messageId
68
+ session . bingWeb_jailbreakConversationCache = bingAIClient . conversationsCache . get (
69
+ response . jailbreakConversationId ,
70
+ )
71
+ }
54
72
55
73
if ( response . details . sourceAttributions . length > 0 ) {
56
74
const footnotes =
0 commit comments