Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Tts add voice choose (#2453)

Charlie.Weic8ca3ff4045a
diff --git a/api/core/model_runtime/model_providers/openai/tts/tts-1-hd.yaml b/api/core/model_runtime/model_providers/openai/tts/tts-1-hd.yaml
index 94473edf9af..72f15134eab 100644
--- a/api/core/model_runtime/model_providers/openai/tts/tts-1-hd.yaml
+++ b/api/core/model_runtime/model_providers/openai/tts/tts-1-hd.yaml
@@ -5,22 +5,22 @@ model_properties:
voices:
- mode: 'alloy'
name: 'Alloy'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
- mode: 'echo'
name: 'Echo'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
- mode: 'fable'
name: 'Fable'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
- mode: 'onyx'
name: 'Onyx'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
- mode: 'nova'
name: 'Nova'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
- mode: 'shimmer'
name: 'Shimmer'
- language: ['zh-Hans', 'en-US']
+ language: [ 'zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID' ]
word_limit: 120
audio_type: 'mp3'
max_workers: 5
diff --git a/api/core/model_runtime/model_providers/openai/tts/tts-1.yaml b/api/core/model_runtime/model_providers/openai/tts/tts-1.yaml
index ca8cbfac732..8d222fed647 100644
--- a/api/core/model_runtime/model_providers/openai/tts/tts-1.yaml
+++ b/api/core/model_runtime/model_providers/openai/tts/tts-1.yaml
@@ -5,22 +5,22 @@ model_properties:
voices:
- mode: 'alloy'
name: 'Alloy'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
- mode: 'echo'
name: 'Echo'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
- mode: 'fable'
name: 'Fable'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
- mode: 'onyx'
name: 'Onyx'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
- mode: 'nova'
name: 'Nova'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
- mode: 'shimmer'
name: 'Shimmer'
- language: ['zh-Hans', 'en-US']
+ language: ['zh-Hans', 'en-US', 'de-DE', 'fr-FR', 'es-ES', 'it-IT', 'th-TH', 'id-ID']
word_limit: 120
audio_type: 'mp3'
max_workers: 5
diff --git a/web/app/components/app/configuration/config-voice/param-config-content.tsx b/web/app/components/app/configuration/config-voice/param-config-content.tsx
index 2eae80decdd..953bca30a02 100644
--- a/web/app/components/app/configuration/config-voice/param-config-content.tsx
+++ b/web/app/components/app/configuration/config-voice/param-config-content.tsx
@@ -70,7 +70,7 @@ const VoiceParamConfig: FC = () => {
<div className={'relative h-9'}>
<Listbox.Button className={'w-full h-full rounded-lg border-0 bg-gray-100 py-1.5 pl-3 pr-10 sm:text-sm sm:leading-6 focus-visible:outline-none focus-visible:bg-gray-200 group-hover:bg-gray-200 cursor-pointer'}>
<span className={classNames('block truncate text-left', !languageItem?.name && 'text-gray-400')}>
- {t(`common.voice.language.${languageItem?.value.replace('-', '')}`) ?? localLanguagePlaceholder}
+ {languageItem?.name ? t(`common.voice.language.${languageItem?.value.replace('-', '')}`) : localLanguagePlaceholder}
</span>
<span className="pointer-events-none absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronDownIcon
diff --git a/web/i18n/lang/app-debug.pt.ts b/web/i18n/lang/app-debug.pt.ts
index caef2133955..0ab8c45d8d1 100644
--- a/web/i18n/lang/app-debug.pt.ts
+++ b/web/i18n/lang/app-debug.pt.ts
@@ -71,6 +71,11 @@ const translation = {
description: 'Uma vez ativado, você pode usar entrada de voz.',
resDes: 'Entrada de voz está ativada',
},
+ textToSpeech: {
+ title: 'Texto para voz',
+ description: 'Quando ativado, o texto pode ser convertido em fala.',
+ resDes: 'Texto para áudio ativado',
+ },
citation: {
title: 'Citações e Atribuições',
description: 'Uma vez ativado, mostra o documento de origem e a seção atribuída do conteúdo gerado.',
@@ -293,6 +298,17 @@ const translation = {
uploadLimit: 'Limite de Upload',
},
},
+ voice: {
+ name: 'voz',
+ description: 'Texto para configurações de timbre de voz',
+ settings: 'As configurações',
+ voiceSettings: {
+ title: 'voz As configurações',
+ language: 'línguas',
+ resolutionTooltip: 'Texto para voz timbre suporta idiomas.',
+ voice: 'voz',
+ },
+ },
openingStatement: {
title: 'Abertura da Conversa',
add: 'Adicionar',
diff --git a/web/i18n/lang/common.pt.ts b/web/i18n/lang/common.pt.ts
index 390d4252d8c..9202cb35eda 100644
--- a/web/i18n/lang/common.pt.ts
+++ b/web/i18n/lang/common.pt.ts
@@ -12,6 +12,18 @@ const translation = {
displayLanguage: 'Idioma de exibição',
timezone: 'Fuso horário',
},
+ voice: {
+ language: {
+ zhHans: 'chinês',
+ enUS: 'inglês',
+ deDE: 'alemão',
+ frFR: 'francês',
+ esES: 'espanhol',
+ itIT: 'italiano',
+ thTH: 'tailandês',
+ idID: 'indonésio',
+ },
+ },
provider: {
apiKey: 'Chave da API',
enterYourKey: 'Insira sua chave da API aqui',