mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
feat: complete bing styles (bing is passed tone style)
This commit is contained in:
parent
b07b74ba54
commit
26e7a715e0
1 changed files with 11 additions and 4 deletions
|
|
@ -2,7 +2,7 @@ require('dotenv').config();
|
||||||
const { KeyvFile } = require('keyv-file');
|
const { KeyvFile } = require('keyv-file');
|
||||||
|
|
||||||
const askBing = async ({ text, onProgress, convo }) => {
|
const askBing = async ({ text, onProgress, convo }) => {
|
||||||
const { BingAIClient } = (await import('@waylaidwanderer/chatgpt-api'));
|
const { BingAIClient } = await import('@waylaidwanderer/chatgpt-api');
|
||||||
|
|
||||||
const bingAIClient = new BingAIClient({
|
const bingAIClient = new BingAIClient({
|
||||||
// "_U" cookie from bing.com
|
// "_U" cookie from bing.com
|
||||||
|
|
@ -11,7 +11,7 @@ const askBing = async ({ text, onProgress, convo }) => {
|
||||||
// cookies: '',
|
// cookies: '',
|
||||||
debug: false,
|
debug: false,
|
||||||
cache: { store: new KeyvFile({ filename: './data/cache.json' }) },
|
cache: { store: new KeyvFile({ filename: './data/cache.json' }) },
|
||||||
proxy: process.env.PROXY || null,
|
proxy: process.env.PROXY || null
|
||||||
});
|
});
|
||||||
|
|
||||||
let options = { onProgress };
|
let options = { onProgress };
|
||||||
|
|
@ -19,8 +19,15 @@ const askBing = async ({ text, onProgress, convo }) => {
|
||||||
options = { ...options, ...convo };
|
options = { ...options, ...convo };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options?.jailbreakConversationId == 'false')
|
if (options?.jailbreakConversationId == 'false') {
|
||||||
options.jailbreakConversationId = false
|
options.jailbreakConversationId = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (convo.toneStyle) {
|
||||||
|
options.toneStyle = convo.toneStyle;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log('bing options', options);
|
||||||
|
|
||||||
const res = await bingAIClient.sendMessage(text, options);
|
const res = await bingAIClient.sendMessage(text, options);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue