diff --git a/api/core/app/apps/advanced_chat/app_generator_tts_publisher.py b/api/core/app/apps/advanced_chat/app_generator_tts_publisher.py index a506447671..4e6422e2df 100644 --- a/api/core/app/apps/advanced_chat/app_generator_tts_publisher.py +++ b/api/core/app/apps/advanced_chat/app_generator_tts_publisher.py @@ -56,7 +56,7 @@ def _process_future( class AppGeneratorTTSPublisher: - def __init__(self, tenant_id: str, voice: str): + def __init__(self, tenant_id: str, voice: str, language: Optional[str] = None): self.logger = logging.getLogger(__name__) self.tenant_id = tenant_id self.msg_text = "" @@ -67,7 +67,7 @@ class AppGeneratorTTSPublisher: self.model_instance = self.model_manager.get_default_model_instance( tenant_id=self.tenant_id, model_type=ModelType.TTS ) - self.voices = self.model_instance.get_tts_voices() + self.voices = self.model_instance.get_tts_voices(language=language) values = [voice.get("value") for voice in self.voices] self.voice = voice if not voice or voice not in values: diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py index ed936643dd..6032a820cb 100644 --- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py +++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py @@ -225,7 +225,9 @@ class AdvancedChatAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCyc and features_dict["text_to_speech"].get("enabled") and features_dict["text_to_speech"].get("autoPlay") == "enabled" ): - tts_publisher = AppGeneratorTTSPublisher(tenant_id, features_dict["text_to_speech"].get("voice")) + tts_publisher = AppGeneratorTTSPublisher( + tenant_id, features_dict["text_to_speech"].get("voice"), features_dict["text_to_speech"].get("language") + ) for response in self._process_stream_response(tts_publisher=tts_publisher, trace_manager=trace_manager): while True: diff --git a/api/core/app/apps/workflow/generate_task_pipeline.py b/api/core/app/apps/workflow/generate_task_pipeline.py index df48a83316..9820cb388f 100644 --- a/api/core/app/apps/workflow/generate_task_pipeline.py +++ b/api/core/app/apps/workflow/generate_task_pipeline.py @@ -194,7 +194,9 @@ class WorkflowAppGenerateTaskPipeline(BasedGenerateTaskPipeline, WorkflowCycleMa and features_dict["text_to_speech"].get("enabled") and features_dict["text_to_speech"].get("autoPlay") == "enabled" ): - tts_publisher = AppGeneratorTTSPublisher(tenant_id, features_dict["text_to_speech"].get("voice")) + tts_publisher = AppGeneratorTTSPublisher( + tenant_id, features_dict["text_to_speech"].get("voice"), features_dict["text_to_speech"].get("language") + ) for response in self._process_stream_response(tts_publisher=tts_publisher, trace_manager=trace_manager): while True: diff --git a/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py b/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py index c84f8ba3e4..8c9c26d36e 100644 --- a/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py +++ b/api/core/app/task_pipeline/easy_ui_based_generate_task_pipeline.py @@ -215,7 +215,9 @@ class EasyUIBasedGenerateTaskPipeline(BasedGenerateTaskPipeline, MessageCycleMan and text_to_speech_dict.get("autoPlay") == "enabled" and text_to_speech_dict.get("enabled") ): - publisher = AppGeneratorTTSPublisher(tenant_id, text_to_speech_dict.get("voice", None)) + publisher = AppGeneratorTTSPublisher( + tenant_id, text_to_speech_dict.get("voice", None), text_to_speech_dict.get("language", None) + ) for response in self._process_stream_response(publisher=publisher, trace_manager=trace_manager): while True: audio_response = self._listen_audio_msg(publisher, task_id) diff --git a/api/core/plugin/entities/plugin_daemon.py b/api/core/plugin/entities/plugin_daemon.py index 7df8859bcf..1588cbc3c7 100644 --- a/api/core/plugin/entities/plugin_daemon.py +++ b/api/core/plugin/entities/plugin_daemon.py @@ -59,6 +59,7 @@ class PluginBasicBooleanResponse(BaseModel): """ result: bool + credentials: dict | None = None class PluginModelSchemaEntity(BaseModel): diff --git a/api/core/plugin/manager/model.py b/api/core/plugin/manager/model.py index 2862cd9a25..5ebc0c2320 100644 --- a/api/core/plugin/manager/model.py +++ b/api/core/plugin/manager/model.py @@ -95,6 +95,9 @@ class PluginModelManager(BasePluginManager): ) for resp in response: + if resp.credentials and isinstance(resp.credentials, dict): + credentials.update(resp.credentials) + return resp.result return False @@ -132,6 +135,9 @@ class PluginModelManager(BasePluginManager): ) for resp in response: + if resp.credentials and isinstance(resp.credentials, dict): + credentials.update(resp.credentials) + return resp.result return False diff --git a/docker/docker-compose.middleware.yaml b/docker/docker-compose.middleware.yaml index 4cbd2a776a..ebcf6c5c92 100644 --- a/docker/docker-compose.middleware.yaml +++ b/docker/docker-compose.middleware.yaml @@ -82,7 +82,7 @@ services: SERVER_KEY: ${PLUGIN_DAEMON_KEY:-lYkiYYT6owG+71oLerGzA7GXCgOT++6ovaezWAjpCjf+Sjc3ZtU+qUEi} MAX_PLUGIN_PACKAGE_SIZE: ${PLUGIN_MAX_PACKAGE_SIZE:-52428800} PPROF_ENABLED: ${PLUGIN_PPROF_ENABLED:-false} - DIFY_INNER_API_URL: ${PLUGIN_DIFY_INNER_API_URL:-http://api:5001} + DIFY_INNER_API_URL: ${PLUGIN_DIFY_INNER_API_URL:-http://host.docker.internal:5001} DIFY_INNER_API_KEY: ${PLUGIN_DIFY_INNER_API_KEY:-QaHbTe77CtuXmsfyhR7+vRjI/+XbV1AaFy691iy+kGDv2Jvy0/eAh8Y1} PLUGIN_REMOTE_INSTALLING_HOST: ${PLUGIN_DEBUGGING_HOST:-0.0.0.0} PLUGIN_REMOTE_INSTALLING_PORT: ${PLUGIN_DEBUGGING_PORT:-5003}