From 9e9d8145ff1b5a9fb5496fefcf307b5d6cc2d755 Mon Sep 17 00:00:00 2001 From: Richard-Weiss <76665424+Richard-Weiss@users.noreply.github.com> Date: Sun, 13 Aug 2023 18:30:09 +0200 Subject: [PATCH] feat(bing): add functionality for receiving internal queries --- src/BingAIClient.js | 55 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/src/BingAIClient.js b/src/BingAIClient.js index 1ba5237..e5910e8 100644 --- a/src/BingAIClient.js +++ b/src/BingAIClient.js @@ -330,25 +330,55 @@ export default class BingAIClient { const obj = { arguments: [ { - source: 'cib', optionsSets: [ 'nlu_direct_response_filter', 'deepleo', 'disable_emoji_spoken_text', 'responsible_ai_policy_235', 'enablemm', - toneOption, - 'dtappid', - 'cricinfo', - 'cricinfov2', 'dv3sugg', - 'nojbfedge', + // 'autosave', // Saves conversations to vanilla bing conversation history + 'iyxapbing', + 'iycapbing', + toneOption, + 'clgalileo', ...((toneStyle === 'creative' && this.options.features.genImage) ? ['gencontentv3'] : []), + 'fluxsrtrunc', + 'fluxtrunc', + 'fluxv1', + 'rai278', + 'replaceurl', + // 'savemem', // Saves conversations to vanilla bing conversation history + // 'savememfilter', // Saves conversations to vanilla bing conversation history + 'eredirecturl', + 'nojbfedge', // Not included in standard message, but won't work without. + ], + allowedMessageTypes: [ + 'ActionRequest', + 'Chat', + 'Context', + 'InternalSearchQuery', + 'InternalSearchResult', + // 'Disengage', unwanted + 'InternalLoaderMessage', + 'Progress', + 'RenderCardRequest', + // 'AdsQuery', unwanted + // 'SemanticSerp',// usually not encountered, related to semantic web search + 'GenerateContentQuery', + 'SearchQuery', ], sliceIds: [ - '222dtappid', - '225cricinfo', - '224locals0', + 'abv2', + 'srdicton', + 'convcssclick', + 'stylewv2', + 'contctxp2tf', + '802fluxv1pc_a', + '806log2sphs0', + '727savemem', + '277teditgnds0', + '207hlthgrds0', ], traceId: genRanHex(32), isStartOfSession: invocationId === 0, @@ -448,6 +478,13 @@ export default class BingAIClient { }); return; } + // Usable later when displaying internal processes, but should be discarded for now. + if (messages[0]?.messageType === 'InternalLoaderMessage' + || messages[0]?.messageType === 'InternalSearchQuery' + || messages[0]?.messageType === 'InternalSearchResult' + || messages[0]?.messageType === 'GenerateContentQuery') { + return; + } const updatedText = messages[0].text; if (!updatedText || updatedText === replySoFar) { return;