diff --git a/api/core/entities/provider_configuration.py b/api/core/entities/provider_configuration.py index 8f8bf38f58934b..214265892fca88 100644 --- a/api/core/entities/provider_configuration.py +++ b/api/core/entities/provider_configuration.py @@ -168,6 +168,8 @@ def add_or_update_custom_credentials(self, credentials: dict) -> None: db.session.add(provider_record) db.session.commit() + self.switch_preferred_provider_type(ProviderType.CUSTOM) + def delete_custom_credentials(self) -> None: """ Delete custom provider credentials. diff --git a/api/services/audio_service.py b/api/services/audio_service.py index 5e177427844735..2f4a73c3ac7a0c 100644 --- a/api/services/audio_service.py +++ b/api/services/audio_service.py @@ -36,4 +36,4 @@ def transcript(cls, tenant_id: str, file: FileStorage): buffer = io.BytesIO(file_content) buffer.name = 'temp.mp3' - return model_instance.invoke_speech2text(buffer) + return {"text": model_instance.invoke_speech2text(buffer)}