mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
Fix (PaLM2): Persist PaLM presets after initial message (#366)
* refactor(askGoogle.js): extract saveConvo function call to a separate function feat(askGoogle.js): add endpoint property to the conversation object refactor(handleSubmit.js): rename chatGptLabel to modelLabel in useMessageHandler function * refactor(askGoogle.js): remove unused endpointOption spread operator
This commit is contained in:
parent
4eda4542b7
commit
07fa0f39fd
2 changed files with 9 additions and 2 deletions
|
|
@ -119,6 +119,13 @@ const ask = async ({ text, endpointOption, parentMessageId = null, conversationI
|
||||||
abortController
|
abortController
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await saveConvo(req.user.id, {
|
||||||
|
...endpointOption,
|
||||||
|
...endpointOption.modelOptions,
|
||||||
|
conversationId,
|
||||||
|
endpoint: 'google'
|
||||||
|
});
|
||||||
|
|
||||||
await saveMessage(response);
|
await saveMessage(response);
|
||||||
sendMessage(res, {
|
sendMessage(res, {
|
||||||
title: await getConvoTitle(req.user.id, conversationId),
|
title: await getConvoTitle(req.user.id, conversationId),
|
||||||
|
|
@ -132,7 +139,7 @@ const ask = async ({ text, endpointOption, parentMessageId = null, conversationI
|
||||||
if (parentMessageId == '00000000-0000-0000-0000-000000000000') {
|
if (parentMessageId == '00000000-0000-0000-0000-000000000000') {
|
||||||
const title = await titleConvo({ text, response });
|
const title = await titleConvo({ text, response });
|
||||||
await saveConvo(req.user.id, {
|
await saveConvo(req.user.id, {
|
||||||
conversationId: conversationId,
|
conversationId,
|
||||||
title
|
title
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ const useMessageHandler = () => {
|
||||||
currentConversation?.model ??
|
currentConversation?.model ??
|
||||||
endpointsConfig[endpoint]?.availableModels?.[0] ??
|
endpointsConfig[endpoint]?.availableModels?.[0] ??
|
||||||
'chat-bison',
|
'chat-bison',
|
||||||
chatGptLabel: currentConversation?.chatGptLabel ?? null,
|
modelLabel: currentConversation?.modelLabel ?? null,
|
||||||
promptPrefix: currentConversation?.promptPrefix ?? null,
|
promptPrefix: currentConversation?.promptPrefix ?? null,
|
||||||
examples: currentConversation?.examples ?? [
|
examples: currentConversation?.examples ?? [
|
||||||
{ input: { content: '' }, output: { content: '' } }
|
{ input: { content: '' }, output: { content: '' } }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue