Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix autosend and autoplay not working #2063

Merged
merged 1 commit into from
Jan 22, 2025
Merged

Conversation

shaohuzhang1
Copy link
Contributor

fix: Fix autosend and autoplay not working --bug=1051779 --user=刘瑞斌 【应用】应用演示页面,不能自动播放回答内容 https://www.tapd.cn/57709429/s/1649281

--bug=1051779 --user=刘瑞斌 【应用】应用演示页面,不能自动播放回答内容 https://www.tapd.cn/57709429/s/1649281
Copy link

f2c-ci-robot bot commented Jan 22, 2025

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Jan 22, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@@ -981,6 +981,8 @@ def profile(self, with_valid=True):
'stt_model_enable': application.stt_model_enable,
'tts_model_enable': application.tts_model_enable,
'tts_type': application.tts_type,
'tts_autoplay': application.tts_autoplay,
'stt_autosend': application.stt_autosend,
'file_upload_enable': application.file_upload_enable,
'file_upload_setting': application.file_upload_setting,
'work_flow': application.work_flow,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The provided code snippet appears to be part of a method defined within an profile function in a Python class. It is adding additional key-value pairs for two new settings (tts_autoplay and stt_autosend) to a dictionary being populated for use as application configuration data. This could potentially enhance the functionality or user experience by allowing users to decide whether their text-to-speech (TTS) outputs should automatically start playing after creation, and vice versa for speech-to-text (STT) results.

However, some minor points can be improved:

  1. Indentation: The lines associated with the new key-value pairs should also have consistent indentation (4 spaces at a time, similar to existing lines).

  2. Consistent Key Naming Conventions: Ensure that all keys maintain consistent naming conventions, such as using underscore separation if applicable (e.g., tts_autoplay_enabled, etc.).

Here is the refactored version:

@@ -981,6 +981,8 @@ def profile(self, with_valid=True):
                  'stt_model_enable': application.stt_model_enable,
                  'tts_model_enable': application.tts_model_enable,
                  'tts_type': application.tts_type,
+                 'tts_autoplay_enabled': application.tts_autoplay_enabled,
+                 'stt_autosend_enabled': application.stt_autosend_enabled,
                  'file_upload_enable': application.file_upload_enable,
                  'file_upload_setting': application.file_upload_setting,
                  'work_flow': application.work_flow,

These slight adjustments make the code clearer and more professional-looking while maintaining its intended functionality.

@liuruibin liuruibin merged commit 495ac39 into main Jan 22, 2025
4 checks passed
@liuruibin liuruibin deleted the pr@main@fix_audo_send branch January 22, 2025 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants