feat: add option to remove reasoning tag from TTS output
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user