mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-18 01:10:14 +01:00
fix: rewrite ask openAI and ask BingAI. now all code cleaned.
This commit is contained in:
parent
f922a1d102
commit
d864da6a21
8 changed files with 165 additions and 341 deletions
|
|
@ -30,23 +30,38 @@ const askBing = async ({
|
|||
proxy: process.env.PROXY || null
|
||||
});
|
||||
|
||||
let options = {
|
||||
jailbreakConversationId: jailbreakConversationId || jailbreak,
|
||||
context,
|
||||
systemMessage,
|
||||
parentMessageId,
|
||||
conversationId: jailbreakConversationId ? jailbreakConversationId : conversationId,
|
||||
toneStyle,
|
||||
onProgress
|
||||
};
|
||||
let options = {};
|
||||
|
||||
if (conversationSignature) options.conversationSignature = conversationSignature;
|
||||
if (conversationSignature) options.clientId = clientId;
|
||||
if (conversationSignature) options.invocationId = invocationId;
|
||||
if (conversationSignature) options.toneStyle = toneStyle;
|
||||
if (jailbreakConversationId == 'false') {
|
||||
jailbreakConversationId = false;
|
||||
}
|
||||
|
||||
if (options?.jailbreakConversationId == 'false') {
|
||||
options.jailbreakConversationId = false;
|
||||
if (jailbreak)
|
||||
options = {
|
||||
jailbreakConversationId: jailbreakConversationId || jailbreak,
|
||||
context,
|
||||
systemMessage,
|
||||
parentMessageId,
|
||||
toneStyle,
|
||||
onProgress
|
||||
};
|
||||
else {
|
||||
options = {
|
||||
conversationId,
|
||||
context,
|
||||
systemMessage,
|
||||
parentMessageId,
|
||||
toneStyle,
|
||||
onProgress
|
||||
};
|
||||
|
||||
// don't give those parameters for new conversation
|
||||
// for new conversation, conversationSignature always is null
|
||||
if (conversationSignature) {
|
||||
options.conversationSignature = conversationSignature;
|
||||
options.clientId = clientId;
|
||||
options.invocationId = invocationId;
|
||||
}
|
||||
}
|
||||
|
||||
console.log('bing options', options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue