feat: sydney mode of bing

This commit is contained in:
josc146
2023-04-14 23:22:56 +08:00
parent 617aa87588
commit ff2f0ff14a
2 changed files with 5 additions and 3 deletions
+3 -1
View File
@@ -10,6 +10,7 @@ import { pushRecord, setAbortController } from './shared.mjs'
*/
export async function generateAnswersWithBingWebApi(port, question, session, accessToken) {
const { controller, messageListener } = setAbortController(port)
const config = await getUserConfig()
const bingAIClient = new BingAIClient({ userToken: accessToken })
@@ -17,7 +18,8 @@ export async function generateAnswersWithBingWebApi(port, question, session, acc
const response = await bingAIClient
.sendMessage(question, {
abortController: controller,
toneStyle: (await getUserConfig()).modelMode,
toneStyle: config.modelMode,
jailbreakConversationId: config.sydneyMode,
onProgress: (token) => {
answer += token
// remove reference markers [^number^]
+2 -2
View File
@@ -317,8 +317,8 @@ export default class BingAIClient {
isStartOfSession: invocationId === 0,
message: {
author: 'user',
text: jailbreakConversationId ? 'Continue the conversation' : message,
messageType: 'SearchQuery',
text: jailbreakConversationId ? '' : message,
messageType: jailbreakConversationId ? 'SearchQuery' : 'Chat',
},
conversationSignature,
participant: {