This commit is contained in:
Timothy J. Baek 2024-10-05 17:05:26 -07:00
parent a860e98ab9
commit 3dd1d1bc4a

View File

@ -2071,33 +2071,9 @@
{createMessagePair} {createMessagePair}
on:submit={async (e) => { on:submit={async (e) => {
if (e.detail) { if (e.detail) {
// New user message prompt = '';
let userPrompt = e.detail.prompt;
let userMessageId = uuidv4();
let userMessage = {
id: userMessageId,
parentId: e.detail.parentId,
childrenIds: [],
role: 'user',
content: userPrompt,
models: selectedModels
};
let messageParentId = e.detail.parentId;
if (messageParentId !== null) {
history.messages[messageParentId].childrenIds = [
...history.messages[messageParentId].childrenIds,
userMessageId
];
}
history.messages[userMessageId] = userMessage;
history.currentId = userMessageId;
await tick(); await tick();
await sendPrompt(userPrompt, userMessageId); submitPrompt(e.detail);
} }
}} }}
/> />