feat: add option to remove reasoning tag from TTS output

This commit is contained in:
n4ze3m
2025-02-09 13:00:04 +05:30
parent 023d3c2fb2
commit 084b859e3e
21 changed files with 106 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ import { useTTS } from "@/hooks/useTTS"
import { tagColors } from "@/utils/color"
import { removeModelSuffix } from "@/db/models"
import { GenerationInfo } from "./GenerationInfo"
import { parseReasoning, removeReasoning } from "@/libs/reasoning"
import { parseReasoning, } from "@/libs/reasoning"
import { humanizeMilliseconds } from "@/utils/humanize-milliseconds"
type Props = {
message: string
@@ -213,7 +213,7 @@ export const PlaygroundMessage = (props: Props) => {
cancel()
} else {
speak({
utterance: removeReasoning(props.message)
utterance: props.message
})
}
}}

View File

@@ -17,6 +17,7 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
ttsProvider: "",
voice: "",
ssmlEnabled: false,
removeReasoningTagTTS: true,
elevenLabsApiKey: "",
elevenLabsVoiceId: "",
elevenLabsModel: "",
@@ -209,6 +210,20 @@ export const TTSModeSettings = ({ hideBorder }: { hideBorder?: boolean }) => {
</div>
</div>
<div className="flex sm:flex-row flex-col space-y-4 sm:space-y-0 sm:justify-between">
<span className="text-gray-700 dark:text-neutral-50 ">
{t("generalSettings.tts.removeReasoningTagTTS.label")}
</span>
<div>
<Switch
className="mt-4 sm:mt-0"
{...form.getInputProps("removeReasoningTagTTS", {
type: "checkbox"
})}
/>
</div>
</div>
<div className="flex justify-end">
<SaveButton btnType="submit" />
</div>