fix #539 bing web

This commit is contained in:
josc146
2023-10-30 18:22:38 +08:00
parent f4fdee9150
commit 8dce5d8647
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -37,8 +37,8 @@ export async function generateAnswersWithBingWebApi(
abortController: controller,
toneStyle: modelMode,
jailbreakConversationId: sydneyMode,
onProgress: (token) => {
answer += token
onProgress: (message) => {
answer = message
// reference markers [^number^]
answer = answer.replaceAll(/\[\^(\d+)\^\]/g, '<sup>$1</sup>')
port.postMessage({ answer: answer, done: false, session: null })
+2 -2
View File
@@ -490,8 +490,8 @@ export default class BingAIClient {
return
}
// get the difference between the current text and the previous text
const difference = updatedText.substring(replySoFar.length)
onProgress(difference)
// const difference = updatedText.substring(replySoFar.length)
onProgress(updatedText)
if (updatedText.trim().endsWith(stopToken)) {
stopTokenFound = true
// remove stop token from updated text