11import { ofetch } from 'ofetch'
22import WebSocketAsPromised from 'websocket-as-promised'
33import { BingConversationStyle , getUserConfig } from '~services/user-config'
4+ import { uuid } from '~utils'
45import { ChatError , ErrorCode } from '~utils/errors'
56import { AbstractBot , SendMessageParams } from '../abstract-bot'
67import { createConversation } from './api'
@@ -13,23 +14,25 @@ const OPTIONS_SETS = [
1314 'disable_emoji_spoken_text' ,
1415 'responsible_ai_policy_235' ,
1516 'enablemm' ,
16- 'iycapbing' ,
17- 'iyxapbing' ,
18- 'objopinion' ,
19- 'rweasgv2' ,
20- 'dagslnv1' ,
2117 'dv3sugg' ,
22- 'autosave' ,
23- 'iyoloxap' ,
24- 'iyoloneutral' ,
25- 'clgalileo' ,
26- 'gencontentv3' ,
18+ 'iyxapbing' ,
19+ 'iycapbing' ,
20+ 'galileo' ,
21+ 'saharagenconv5' ,
22+ 'fluxhint' ,
23+ 'glfluxv13' ,
24+ 'uquopt' ,
25+ 'bof107v2' ,
26+ 'streamw' ,
27+ 'rctechalwlst' ,
28+ 'agicert' ,
2729]
2830
2931export class BingWebBot extends AbstractBot {
3032 private conversationContext ?: ConversationInfo
3133
3234 private buildChatRequest ( conversation : ConversationInfo , message : string , imageUrl ?: string ) {
35+ const requestId = uuid ( )
3336 const optionsSets = OPTIONS_SETS
3437 if ( conversation . conversationStyle === BingConversationStyle . Precise ) {
3538 optionsSets . push ( 'h3precise' )
@@ -51,34 +54,38 @@ export class BingWebBot extends AbstractBot {
5154 'SearchQuery' ,
5255 ] ,
5356 sliceIds : [
54- 'winmuid1tf' ,
55- 'anssupfor_c' ,
56- 'imgchatgptv2' ,
57- 'tts2cf' ,
58- 'contansperf' ,
59- 'mlchatpc8500w' ,
60- 'mlchatpc2' ,
61- 'ctrlworkpay' ,
62- 'winshortmsgtf' ,
63- 'cibctrl' ,
64- 'sydtransctrl' ,
57+ '825asmetrics' ,
58+ 'gbacf' ,
59+ 'divkorbl2p' ,
60+ 'emovoice' ,
61+ 'tts3' ,
62+ 'wrapuxslimt' ,
63+ 'rbingchromecf' ,
6564 'sydconfigoptc' ,
66- '0705trt4' ,
67- '517opinion' ,
68- '628ajcopus0' ,
69- '330uaugs0' ,
70- '529rwea' ,
71- '0626snptrcs0' ,
72- '424dagslnv1' ,
65+ '0824cntor' ,
66+ '816bof107v2' ,
67+ '0529streamw' ,
68+ 'streamw' ,
69+ '178gentech' ,
70+ '824fluxhi52s0' ,
71+ '0825agicert' ,
72+ '621alllocs0' ,
73+ '727nrprdrs0' ,
7374 ] ,
75+ scenario : 'SERP' ,
76+ plugins : [ ] ,
7477 isStartOfSession : conversation . invocationId === 0 ,
7578 message : {
79+ timestamp : new Date ( ) . toISOString ( ) ,
7680 author : 'user' ,
7781 inputMethod : 'Keyboard' ,
7882 text : message ,
7983 imageUrl,
8084 messageType : 'Chat' ,
85+ requestId,
86+ messageId : requestId ,
8187 } ,
88+ requestId,
8289 conversationId : conversation . conversationId ,
8390 conversationSignature : conversation . conversationSignature ,
8491 participant : { id : conversation . clientId } ,
0 commit comments