mirror of
https://github.com/wassname/chatGPTBox.git
synced 2026-07-02 18:12:37 +08:00
feat: sydney mode of bing
This commit is contained in:
@@ -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^]
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user