feat: Bing Image Creator

This commit is contained in:
fuegovic 2023-07-20 00:53:21 -04:00 committed by Danny Avila
parent ad29d25396
commit 530f9d303f
3 changed files with 24 additions and 2 deletions

View file

@ -47,6 +47,16 @@ const askBing = async ({
parentMessageId, parentMessageId,
toneStyle, toneStyle,
onProgress, onProgress,
clientOptions: {
features: {
genImage: {
server: {
enable: true,
type: 'markdown_list',
},
},
},
},
}; };
} else { } else {
options = { options = {
@ -56,6 +66,16 @@ const askBing = async ({
parentMessageId, parentMessageId,
toneStyle, toneStyle,
onProgress, onProgress,
clientOptions: {
features: {
genImage: {
server: {
enable: true,
type: 'markdown_list',
},
},
},
},
}; };
// don't give those parameters for new conversation // don't give those parameters for new conversation

View file

@ -172,7 +172,8 @@ const ask = async ({
let unfinished = false; let unfinished = false;
if (partialText?.trim()?.length > response.text.length) { if (partialText?.trim()?.length > response.text.length) {
response.text = partialText; response.text = partialText;
unfinished = true; unfinished = false;
//setting "unfinished" to false fix bing image generation error msg and allows to continue a convo after being triggered by censorship (bing does remember the context after a "censored error" so there is no reason to end the convo)
} }
let responseMessage = { let responseMessage = {

View file

@ -69,7 +69,8 @@ const Content = React.memo(({ content, message }) => {
]; ];
if (!isInitializing || !isLatestMessage) { if (!isInitializing || !isLatestMessage) {
rehypePlugins.pop(); //commented out to fix bing image creator errors
//rehypePlugins.pop();
} }
return ( return (