diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte index 1b565ec7b9..25adf3a8ec 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -9,6 +9,7 @@ import { FileTypeCategory } from '$lib/enums/files'; import { getFileTypeCategory } from '$lib/utils/file-type'; import { supportsAudio } from '$lib/stores/server.svelte'; + import { config } from '$lib/stores/settings.svelte'; import type { ChatUploadedFile } from '$lib/types/chat'; interface Props { @@ -37,11 +38,14 @@ onStop }: Props = $props(); + let currentConfig = $derived(config()); let hasAudioModality = $derived(supportsAudio()); let hasAudioAttachments = $derived( uploadedFiles.some((file) => getFileTypeCategory(file.type) === FileTypeCategory.AUDIO) ); - let shouldShowRecordButton = $derived(hasAudioModality && !hasText && !hasAudioAttachments); + let shouldShowRecordButton = $derived( + hasAudioModality && !hasText && !hasAudioAttachments && currentConfig.autoMicOnEmpty + ); let shouldShowSubmitButton = $derived(!shouldShowRecordButton || hasAudioAttachments); diff --git a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte index d00ae12853..d75948ffda 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatSettings/ChatSettings.svelte @@ -78,12 +78,6 @@ label: 'Show model information', type: 'checkbox' }, - { - key: 'enableContinueGeneration', - label: 'Enable "Continue" button', - type: 'checkbox', - isExperimental: true - }, { key: 'pdfAsImage', label: 'Parse PDF as image', @@ -94,6 +88,18 @@ label: 'Render user content as Markdown', type: 'checkbox' }, + { + key: 'autoMicOnEmpty', + label: 'Show microphone on empty input', + type: 'checkbox', + isExperimental: true + }, + { + key: 'enableContinueGeneration', + label: 'Enable "Continue" button', + type: 'checkbox', + isExperimental: true + }, { key: 'askForTitleConfirmation', label: 'Ask for confirmation before changing conversation title', diff --git a/tools/server/webui/src/lib/constants/settings-config.ts b/tools/server/webui/src/lib/constants/settings-config.ts index c25ea23f37..361860ac2f 100644 --- a/tools/server/webui/src/lib/constants/settings-config.ts +++ b/tools/server/webui/src/lib/constants/settings-config.ts @@ -16,6 +16,7 @@ export const SETTING_CONFIG_DEFAULT: Record = showModelInfo: false, renderUserContentAsMarkdown: false, modelSelectorEnabled: false, + autoMicOnEmpty: false, // make sure these default values are in sync with `common.h` samplers: 'top_k;typ_p;top_p;min_p;temperature', temperature: 0.8, @@ -96,6 +97,8 @@ export const SETTING_CONFIG_INFO: Record = { renderUserContentAsMarkdown: 'Render user messages using markdown formatting in the chat.', modelSelectorEnabled: 'Enable the model selector in the chat input to choose the inference model. Sends the associated model field in API requests.', + autoMicOnEmpty: + 'Automatically show microphone button instead of send button when textarea is empty for models with audio modality support.', pyInterpreterEnabled: 'Enable Python interpreter using Pyodide. Allows running Python code in markdown code blocks.', enableContinueGeneration: