Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
fffded8b
Commit
fffded8b
authored
Nov 10, 2023
by
Timothy J. Baek
Browse files
feat: speech recognition ui added
parent
a9146f7e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
src/routes/+page.svelte
src/routes/+page.svelte
+29
-2
No files found.
src/routes/+page.svelte
View file @
fffded8b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
system
:
null
,
system
:
null
,
temperature
:
null
temperature
:
null
};
};
let
speechRecognition
=
true
;
let
models
=
[];
let
models
=
[];
let
chats
=
[];
let
chats
=
[];
...
@@ -1199,7 +1200,9 @@
...
@@ -1199,7 +1200,9 @@
>
>
<textarea
<textarea
id=
"chat-textarea"
id=
"chat-textarea"
class=
"rounded-xl dark:bg-gray-700 dark:text-gray-100 outline-none border dark:border-gray-700 w-full py-3 px-5 pr-12 resize-none"
class=
"rounded-xl dark:bg-gray-700 dark:text-gray-100 outline-none border dark:border-gray-700 w-full py-3 {speechRecognition
? 'px-12'
: 'pl-5 pr-12'} resize-none"
placeholder=
"Send a message"
placeholder=
"Send a message"
bind:value=
{prompt}
bind:value=
{prompt}
on:keypress=
{(e)
=
>
{
on:keypress=
{(e)
=
>
{
...
@@ -1216,8 +1219,32 @@
...
@@ -1216,8 +1219,32 @@
e.target.style.height = Math.min(e.target.scrollHeight, 200) + 2 + 'px';
e.target.style.height = Math.min(e.target.scrollHeight, 200) + 2 + 'px';
}}
}}
/>
/>
{#if speechRecognition}
<div
class=
" absolute left-0 bottom-0"
>
<div
class=
"pl-2.5 pb-[9px]"
>
<button
class=
" text-gray-700 dark:text-gray-100 transition rounded-lg p-1.5"
on:click=
{()
=
>
{}}
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
viewBox=
"0 0 20 20"
fill=
"currentColor"
class=
"w-5 h-5"
>
<path
d=
"M7 4a3 3 0 016 0v6a3 3 0 11-6 0V4z"
/>
<path
d=
"M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z"
/>
</svg>
</button>
</div>
</div>
{/if}
<div
class=
" absolute right-0 bottom-0"
>
<div
class=
" absolute right-0 bottom-0"
>
<div
class=
"pr-
3
pb-[9px]"
>
<div
class=
"pr-
2.5
pb-[9px]"
>
{#if messages.length == 0 || messages.at(-1).done == true}
{#if messages.length == 0 || messages.at(-1).done == true}
<button
<button
class=
"{prompt !== ''
class=
"{prompt !== ''
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment