Skip to content

Commit

Permalink
feat: sydney mode of bing
Browse files Browse the repository at this point in the history
  • Loading branch information
josStorer committed Apr 14, 2023
1 parent 0065587 commit e8dad13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/background/apis/bing-web.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ 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 })

let answer = ''
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^]
Expand Down
4 changes: 2 additions & 2 deletions src/background/clients/BingAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit e8dad13

Please sign in to comment.