mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-19 01:40:15 +01:00
Merge pull request #120 from HyunggyuJang/refactor/sydney
Refactor sydney & fix error
This commit is contained in:
commit
737abd54ac
2 changed files with 8 additions and 6 deletions
|
|
@ -164,6 +164,8 @@ const ask = async ({
|
||||||
await saveConvo(
|
await saveConvo(
|
||||||
req?.session?.user?.username,
|
req?.session?.user?.username,
|
||||||
{
|
{
|
||||||
|
...convo,
|
||||||
|
...response,
|
||||||
conversationId,
|
conversationId,
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,10 +114,8 @@ const ask = async ({
|
||||||
convo.conversationSignature || response.conversationSignature;
|
convo.conversationSignature || response.conversationSignature;
|
||||||
userMessage.conversationId = response.conversationId || conversationId;
|
userMessage.conversationId = response.conversationId || conversationId;
|
||||||
userMessage.invocationId = response.invocationId;
|
userMessage.invocationId = response.invocationId;
|
||||||
userMessage.messageId = response.parentMessageId || userMessageId;
|
|
||||||
// Unlike gpt and bing, Sydney will never accept our given userMessage.messageId, it will generate its own one.
|
// Unlike gpt and bing, Sydney will never accept our given userMessage.messageId, it will generate its own one.
|
||||||
if (!overrideParentMessageId)
|
userMessage.messageId = response.parentMessageId || userMessageId;
|
||||||
await saveBingMessage({ oldMessageId: userMessageId, ...userMessage });
|
|
||||||
|
|
||||||
// Save sydney response
|
// Save sydney response
|
||||||
// response.id = response.messageId;
|
// response.id = response.messageId;
|
||||||
|
|
@ -141,7 +139,7 @@ const ask = async ({
|
||||||
// Save user message
|
// Save user message
|
||||||
userMessage.conversationId = response.conversationId || conversationId;
|
userMessage.conversationId = response.conversationId || conversationId;
|
||||||
if (!overrideParentMessageId)
|
if (!overrideParentMessageId)
|
||||||
await saveBingMessage(userMessage);
|
await saveBingMessage({ oldMessageId: userMessageId, ...userMessage });
|
||||||
|
|
||||||
// Bing API will not use our conversationId at the first time,
|
// Bing API will not use our conversationId at the first time,
|
||||||
// so change the placeholder conversationId to the real one.
|
// so change the placeholder conversationId to the real one.
|
||||||
|
|
@ -176,6 +174,8 @@ const ask = async ({
|
||||||
await saveConvo(
|
await saveConvo(
|
||||||
req?.session?.user?.username,
|
req?.session?.user?.username,
|
||||||
{
|
{
|
||||||
|
...convo,
|
||||||
|
...response,
|
||||||
conversationId,
|
conversationId,
|
||||||
title
|
title
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue