message container
Browse files
src/lib/components/Playground/Playground.svelte
CHANGED
@@ -251,7 +251,7 @@
|
|
251 |
></button
|
252 |
>
|
253 |
<div class="flex-1 items-center justify-center text-center text-sm text-gray-500">
|
254 |
-
<span class="max-
|
255 |
</div>
|
256 |
<button
|
257 |
type="button"
|
|
|
251 |
></button
|
252 |
>
|
253 |
<div class="flex-1 items-center justify-center text-center text-sm text-gray-500">
|
254 |
+
<span class="max-xl:hidden">0 tokens · Latency {latency}ms</span>
|
255 |
</div>
|
256 |
<button
|
257 |
type="button"
|
src/lib/components/Playground/PlaygroundMessage.svelte
CHANGED
@@ -7,16 +7,19 @@
|
|
7 |
};
|
8 |
|
9 |
export let message: Message;
|
|
|
10 |
|
11 |
const dispatch = createEventDispatcher();
|
12 |
</script>
|
13 |
|
14 |
<div
|
15 |
-
class="@2xl:grid-cols-[130px,1fr,2.5rem] group/message @2xl:gap-4 group grid items-start gap-2 px-6 pb-6 pt-4 hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
16 |
>
|
17 |
-
<div class="pb-2 pt-3 text-sm font-semibold uppercase">
|
|
|
|
|
18 |
<textarea
|
19 |
-
autofocus
|
20 |
bind:value={message.content}
|
21 |
placeholder="Enter {message.role} message"
|
22 |
class="resize-none rounded bg-transparent px-3 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y hover:bg-white focus:resize-y focus:bg-white focus:ring group-hover/message:ring dark:ring-gray-600 dark:hover:bg-gray-900 dark:focus:bg-gray-900"
|
|
|
7 |
};
|
8 |
|
9 |
export let message: Message;
|
10 |
+
export let autofocus: boolean = false;
|
11 |
|
12 |
const dispatch = createEventDispatcher();
|
13 |
</script>
|
14 |
|
15 |
<div
|
16 |
+
class="@2xl:grid-cols-[130px,1fr,2.5rem] group/message @2xl:gap-4 @2xl:grid-rows-1 group grid grid-cols-[1fr,2.5rem] items-start gap-2 px-6 pb-6 pt-4 hover:bg-gray-50 dark:hover:bg-gray-800/50"
|
17 |
>
|
18 |
+
<div class="@2xl:col-span-1 col-span-2 pb-2 pt-3 text-sm font-semibold uppercase">
|
19 |
+
{message.role}
|
20 |
+
</div>
|
21 |
<textarea
|
22 |
+
{autofocus}
|
23 |
bind:value={message.content}
|
24 |
placeholder="Enter {message.role} message"
|
25 |
class="resize-none rounded bg-transparent px-3 py-2.5 ring-gray-100 [field-sizing:content] hover:resize-y hover:bg-white focus:resize-y focus:bg-white focus:ring group-hover/message:ring dark:ring-gray-600 dark:hover:bg-gray-900 dark:focus:bg-gray-900"
|