mirror of
https://github.com/open-webui/open-webui
synced 2025-01-30 22:39:03 +00:00
refac
This commit is contained in:
parent
64b6a8c5db
commit
2972774d87
@ -327,6 +327,9 @@
|
|||||||
chatTextAreaElement.style.height = '';
|
chatTextAreaElement.style.height = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const _files = JSON.parse(JSON.stringify(files));
|
||||||
|
files = [];
|
||||||
|
|
||||||
prompt = '';
|
prompt = '';
|
||||||
|
|
||||||
// Create user message
|
// Create user message
|
||||||
@ -338,7 +341,7 @@
|
|||||||
role: 'user',
|
role: 'user',
|
||||||
user: _user ?? undefined,
|
user: _user ?? undefined,
|
||||||
content: userPrompt,
|
content: userPrompt,
|
||||||
files: files.length > 0 ? files : undefined,
|
files: _files.length > 0 ? _files : undefined,
|
||||||
timestamp: Math.floor(Date.now() / 1000), // Unix epoch
|
timestamp: Math.floor(Date.now() / 1000), // Unix epoch
|
||||||
models: selectedModels.filter((m, mIdx) => selectedModels.indexOf(m) === mIdx)
|
models: selectedModels.filter((m, mIdx) => selectedModels.indexOf(m) === mIdx)
|
||||||
};
|
};
|
||||||
@ -378,9 +381,6 @@
|
|||||||
}
|
}
|
||||||
await tick();
|
await tick();
|
||||||
}
|
}
|
||||||
|
|
||||||
files = [];
|
|
||||||
|
|
||||||
// Send prompt
|
// Send prompt
|
||||||
_responses = await sendPrompt(userPrompt, userMessageId);
|
_responses = await sendPrompt(userPrompt, userMessageId);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user