Skip to content

Commit d229ef3

Browse files
committed
chore: update bing client
1 parent ada5dbf commit d229ef3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/services/clients/bing/index.mjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ export default class BingAIClient {
5757
'x-ms-client-request-id': uuidv4(),
5858
'x-ms-useragent':
5959
'azsdk-js-api-client-factory/1.0.0-beta.1 core-rest-pipeline/1.10.0 OS/Win32',
60-
cookie: this.options.cookies || `_U=${this.options.userToken}`,
60+
cookie:
61+
this.options.cookies ||
62+
(this.options.userToken ? `_U=${this.options.userToken}` : undefined),
6163
Referer: 'https://www.bing.com/search?q=Bing+AI&showconv=1&FORM=hpcodx',
6264
'Referrer-Policy': 'origin-when-cross-origin',
6365
// Workaround for request being blocked due to geolocation
@@ -369,7 +371,7 @@ export default class BingAIClient {
369371
'Timed out waiting for response. Try enabling debug mode to see more information.',
370372
),
371373
)
372-
}, 120 * 1000)
374+
}, 180 * 1000)
373375

374376
// abort the request if the abort controller is aborted
375377
abortController.signal.addEventListener('abort', () => {
@@ -459,7 +461,9 @@ export default class BingAIClient {
459461
jailbreakConversationId &&
460462
(stopTokenFound ||
461463
event.item.messages[0].topicChangerText ||
462-
event.item.messages[0].offense === 'OffenseTrigger')
464+
event.item.messages[0].offense === 'OffenseTrigger' ||
465+
(event.item.messages.length > 1 &&
466+
event.item.messages[1].contentOrigin === 'Apology'))
463467
) {
464468
if (!replySoFar) {
465469
replySoFar =

0 commit comments

Comments
 (0)