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

Workflow TTS playback node filtering issue. #6877

Merged
merged 4 commits into from
Aug 4, 2024

Conversation

ic-xu
Copy link
Contributor

@ic-xu ic-xu commented Aug 1, 2024

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

In the workflow chat, if a workflow contains multiple LLM nodes and the TTS auto-play feature is enabled, then the output of each LLM node will play the LLM. This may not be what the user needs. This fix is to ensure that TTS only plays the text content of the output from the end node, so that whatever the user sees, TTS will play.
eg.

image

In such cases, TTS should only play the output of the LLM2 node, because the final output of the Answer is the data from LLM2, and what the user sees is also the data output by LLM2. Therefore, TTS should only play the data output by LLM2.

Fixes

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

ic-xu added 2 commits August 1, 2024 11:22
…g voices; 2. The bug that the front-end tts loading status must be displayed after the HTTP request is completed; 3. The bug that the front-end console errors when switching voices and the voice does not exist.
…and the TTS auto-play feature is enabled, then the output of each LLM node will play the LLM. This may not be what the user needs. This fix is to ensure that TTS only plays the text content of the output from the end node, so that whatever the user sees, TTS will play.
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🌊 feat:workflow Workflow related stuff. 🐞 bug Something isn't working labels Aug 1, 2024
@ic-xu ic-xu changed the title Workflow tts issues Workflow TTS playback node filtering issue. Aug 1, 2024
@laipz8200
Copy link
Member

What will happen if this workflow has multiple branches and answer nodes?

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Aug 2, 2024
@ic-xu
Copy link
Contributor Author

ic-xu commented Aug 2, 2024

What will happen if this workflow has multiple branches and answer nodes?

Regardless of whether there are multiple workflows or multiple answer nodes, the final output of the program is definitely a single answer node. At this point, the TTS should play the output content of this answer node, which is considered reasonable. This way, what the user hears should match what they see.

@ic-xu
Copy link
Contributor Author

ic-xu commented Aug 2, 2024

I am currently working on improving in this direction, and I have already tested it. If you have any new issues, I hope we can communicate more.

Copy link
Member

@laipz8200 laipz8200 left a comment

Choose a reason for hiding this comment

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

Thanks!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 4, 2024
@laipz8200 laipz8200 merged commit dff3f41 into langgenius:main Aug 4, 2024
5 checks passed
cuiks pushed a commit to cuiks/dify that referenced this pull request Aug 6, 2024
ZhouhaoJiang added a commit that referenced this pull request Aug 6, 2024
* refs/heads/feat/web-app-sso:
  feat: web sso app
  Fixed a bug where permission was clearly displaye… (#6934)
  fix: The permissions issue of the editor role accessing some backend … (#6945)
  Fix: tag & settings modal in dataset card in Firefox (#6953)
  fix: ensure db migration in docker entry script running with `upgrade-db` command for proper locking (#6946)
  chore: fix markdown format and one typo (#6939)
  fix: restore xinference secret field (#6941)
  Fix increase_usage of total_price in agent_runner (#6688)
  fix: import workflow errors (#6937)
  Workflow TTS playback node filtering issue. (#6877)
  compatible xinference reranker server (#6927)
  fix: workflow trace user_id error (#6932)
  fix: sending app trace data to other app trace provider (#6931)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🌊 feat:workflow Workflow related stuff. lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants