mirror of
https://github.com/open-webui/open-webui
synced 2025-03-23 06:17:24 +00:00
refac: playground
This commit is contained in:
parent
e0b7d95429
commit
b11c48ac16
@ -155,7 +155,6 @@
|
|||||||
});
|
});
|
||||||
messages = messages;
|
messages = messages;
|
||||||
message = '';
|
message = '';
|
||||||
role = role === 'user' ? 'assistant' : 'user';
|
|
||||||
await tick();
|
await tick();
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
}
|
}
|
||||||
@ -163,6 +162,8 @@
|
|||||||
|
|
||||||
const submitHandler = async () => {
|
const submitHandler = async () => {
|
||||||
if (selectedModelId) {
|
if (selectedModelId) {
|
||||||
|
await addHandler();
|
||||||
|
|
||||||
loading = true;
|
loading = true;
|
||||||
await chatCompletionHandler();
|
await chatCompletionHandler();
|
||||||
|
|
||||||
@ -338,6 +339,7 @@
|
|||||||
class="px-3.5 py-1.5 text-sm font-medium disabled:bg-gray-50 dark:disabled:hover:bg-gray-850 disabled:cursor-not-allowed bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg"
|
class="px-3.5 py-1.5 text-sm font-medium disabled:bg-gray-50 dark:disabled:hover:bg-gray-850 disabled:cursor-not-allowed bg-gray-50 hover:bg-gray-100 text-gray-900 dark:bg-gray-850 dark:hover:bg-gray-800 dark:text-gray-200 transition rounded-lg"
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
addHandler();
|
addHandler();
|
||||||
|
role = role === 'user' ? 'assistant' : 'user';
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{$i18n.t('Add')}
|
{$i18n.t('Add')}
|
||||||
|
@ -17,12 +17,11 @@
|
|||||||
{#each messages as message, idx}
|
{#each messages as message, idx}
|
||||||
<div class="flex gap-2 group">
|
<div class="flex gap-2 group">
|
||||||
<div class="flex items-start pt-1">
|
<div class="flex items-start pt-1">
|
||||||
<button
|
<div
|
||||||
class="px-2 py-1 text-sm font-semibold uppercase min-w-[6rem] text-left dark:group-hover:bg-gray-800 rounded-lg transition"
|
class="px-2 py-1 text-sm font-semibold uppercase min-w-[6rem] text-left rounded-lg transition"
|
||||||
on:click={() => {
|
|
||||||
message.role = message.role === 'user' ? 'assistant' : 'user';
|
|
||||||
}}>{$i18n.t(message.role)}</button
|
|
||||||
>
|
>
|
||||||
|
{$i18n.t(message.role)}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex-1">
|
<div class="flex-1">
|
||||||
|
Loading…
Reference in New Issue
Block a user