speech-to-text error #237

Closed
opened 2026-02-16 10:18:33 -05:00 by yindo · 7 comments
Owner

Originally created by @chenhui-cyber on GitHub (Apr 28, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Dify connects to the ChatTTS deployed in Xorbits Inference, and uses the tool Text To Speech to prompt the following error:
plugin daemon: {"message":"Key: 'InvokePluginRequest[github.com/langgenius/dify-plugin-daemon/pkg/entities/requests.RequestInvokeTTS].Data.InvokeTTSSchema.Voice' Error:Field validation for 'Voice' failed on the 'required' tag","error_type":"PluginDaemonBadRequestError","args":null}, code: -400

✔️ Expected Behavior

how to resolve?

Actual Behavior

No response

Originally created by @chenhui-cyber on GitHub (Apr 28, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce Dify connects to the ChatTTS deployed in Xorbits Inference, and uses the tool Text To Speech to prompt the following error: plugin daemon: {"message":"Key: 'InvokePluginRequest[github.com/langgenius/dify-plugin-daemon/pkg/entities/requests.RequestInvokeTTS].Data.InvokeTTSSchema.Voice' Error:Field validation for 'Voice' failed on the 'required' tag","error_type":"PluginDaemonBadRequestError","args":null}, code: -400 ### ✔️ Expected Behavior how to resolve? ### ❌ Actual Behavior _No response_
yindo closed this issue 2026-02-16 10:18:33 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 29, 2025):

Hello @chenhui-cyber! I'm Dosu, your friendly bot here to help you with bugs, questions, and becoming a contributor. While you're waiting for a human maintainer, feel free to share more details about the issue you're facing!

I found some relevant information that might help you resolve the issue you're facing with the Text To Speech functionality in Dify.

The error PluginDaemonBadRequestError indicates that the 'Voice' field in the 'InvokeTTSSchema' is missing or not provided, and it is required for the Text To Speech functionality. To resolve this issue, ensure that the 'Voice' field is included and correctly specified in your request to the Text To Speech plugin. The 'Voice' field is used for configuring voice settings, such as selecting the voice and setting the language [1].

Additionally, there is a similar closed issue where the suggested solution was to ensure that the voice parameter is correctly handled and passed through the relevant functions and API calls. You may need to modify the code to include the voice parameter where necessary, such as updating the XinferenceModelExtraParameter class and related methods to include and handle the voice parameter. Also, ensure that your Dify Docker deployment is correctly configured to access the Xinference endpoint by using the machine's IP address instead of localhost [2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 29, 2025): <!-- Greeting --> Hello @chenhui-cyber! I'm [Dosu](https://dosu.dev), your friendly bot here to help you with bugs, questions, and becoming a contributor. While you're waiting for a human maintainer, feel free to share more details about the issue you're facing! <!-- Answer --> I found some relevant information that might help you resolve the issue you're facing with the Text To Speech functionality in Dify. The error `PluginDaemonBadRequestError` indicates that the 'Voice' field in the 'InvokeTTSSchema' is missing or not provided, and it is required for the Text To Speech functionality. To resolve this issue, ensure that the 'Voice' field is included and correctly specified in your request to the Text To Speech plugin. The 'Voice' field is used for configuring voice settings, such as selecting the voice and setting the language <sup>[[1]](https://github.com/langgenius/dify/issues/15501)</sup>. Additionally, there is a similar closed issue where the suggested solution was to ensure that the `voice` parameter is correctly handled and passed through the relevant functions and API calls. You may need to modify the code to include the `voice` parameter where necessary, such as updating the `XinferenceModelExtraParameter` class and related methods to include and handle the `voice` parameter. Also, ensure that your Dify Docker deployment is correctly configured to access the Xinference endpoint by using the machine's IP address instead of `localhost` <sup>[[2]](https://github.com/langgenius/dify/issues/17459)</sup>. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/9b9ef345-277c-4a7d-a5e0-29ab3620cdbd?feedback_type=other)</sup>
Author
Owner

@yarcowang commented on GitHub (Jun 1, 2025):

dify-plugin-daemon 项目中,去掉voice字段的required规则 似乎就可以了~

diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go
index 63c9f96..50a90ad 100644
--- a/pkg/entities/requests/model.go
+++ b/pkg/entities/requests/model.go
@@ -61,7 +61,7 @@ type RequestInvokeRerank struct {
 
 type InvokeTTSSchema struct {
        ContentText string `json:"content_text"  validate:"required"`
-       Voice       string `json:"voice" validate:"required"`
+       Voice       string `json:"voice"`
        TenantID    string `json:"tenant_id" validate:"required"`
 }

ChatTTS有默认voice, dify webui上也没看到那个字段是必选的。
不过语音效果中,输入的文本可能带思考过程,比如qwen 会输出 <think>...</think>, 在发送给TTS也会被当成需要转换成语音的。
Image
也许要在这里截断发送?

@yarcowang commented on GitHub (Jun 1, 2025): dify-plugin-daemon 项目中,去掉voice字段的required规则 似乎就可以了~ ``` diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go index 63c9f96..50a90ad 100644 --- a/pkg/entities/requests/model.go +++ b/pkg/entities/requests/model.go @@ -61,7 +61,7 @@ type RequestInvokeRerank struct { type InvokeTTSSchema struct { ContentText string `json:"content_text" validate:"required"` - Voice string `json:"voice" validate:"required"` + Voice string `json:"voice"` TenantID string `json:"tenant_id" validate:"required"` } ``` ChatTTS有默认voice, dify webui上也没看到那个字段是必选的。 不过语音效果中,输入的文本可能带思考过程,比如qwen 会输出 `<think>...</think>`, 在发送给TTS也会被当成需要转换成语音的。 <img width="442" alt="Image" src="https://github.com/user-attachments/assets/2ce43392-e584-409c-898e-b9cd10b1c537" /> 也许要在这里截断发送?
Author
Owner

@FeyaM commented on GitHub (Jun 11, 2025):

dify-plugin-daemon 项目中,去掉voice字段的required规则 似乎就可以了~

diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go
index 63c9f96..50a90ad 100644
--- a/pkg/entities/requests/model.go
+++ b/pkg/entities/requests/model.go
@@ -61,7 +61,7 @@ type RequestInvokeRerank struct {
 
 type InvokeTTSSchema struct {
        ContentText string `json:"content_text"  validate:"required"`
-       Voice       string `json:"voice" validate:"required"`
+       Voice       string `json:"voice"`
        TenantID    string `json:"tenant_id" validate:"required"`
 }

ChatTTS有默认voice, dify webui上也没看到那个字段是必选的。 不过语音效果中,输入的文本可能带思考过程,比如qwen 会输出 <think>...</think>, 在发送给TTS也会被当成需要转换成语音的。 Image 也许要在这里截断发送?

但是TTS应该允许选择音色、或者传入克隆原始语音。默认的话就没法使用了

@FeyaM commented on GitHub (Jun 11, 2025): > dify-plugin-daemon 项目中,去掉voice字段的required规则 似乎就可以了~ > > ``` > diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go > index 63c9f96..50a90ad 100644 > --- a/pkg/entities/requests/model.go > +++ b/pkg/entities/requests/model.go > @@ -61,7 +61,7 @@ type RequestInvokeRerank struct { > > type InvokeTTSSchema struct { > ContentText string `json:"content_text" validate:"required"` > - Voice string `json:"voice" validate:"required"` > + Voice string `json:"voice"` > TenantID string `json:"tenant_id" validate:"required"` > } > ``` > > ChatTTS有默认voice, dify webui上也没看到那个字段是必选的。 不过语音效果中,输入的文本可能带思考过程,比如qwen 会输出 `<think>...</think>`, 在发送给TTS也会被当成需要转换成语音的。 <img alt="Image" width="442" src="https://private-user-images.githubusercontent.com/1576504/449770086-2ce43392-e584-409c-898e-b9cd10b1c537.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDk2MzcxMTUsIm5iZiI6MTc0OTYzNjgxNSwicGF0aCI6Ii8xNTc2NTA0LzQ0OTc3MDA4Ni0yY2U0MzM5Mi1lNTg0LTQwOWMtODk4ZS1iOWNkMTBiMWM1MzcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MTFUMTAxMzM1WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDZmMjE4OWFkYmM3MTZhNzQ1YjY3MmRkNjI5ODMwZTE2MDg0OWFlNmZhZjg5ZTcyNTU4YmIyODk0MGIxNzRjNSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.rq8GqxYyIjlIsscTLn8UghUUtLjODO4jXhWKbr2mixM"> 也许要在这里截断发送? 但是TTS应该允许选择音色、或者传入克隆原始语音。默认的话就没法使用了
Author
Owner

@yarcowang commented on GitHub (Jun 11, 2025):

@FeyaM
不同TTS肯定不一样的。我这里是把required去掉变成optional, 又不是把这个字段去掉~而且dify界面也没标识必选,前后端有点不一致呢~

@yarcowang commented on GitHub (Jun 11, 2025): @FeyaM 不同TTS肯定不一样的。我这里是把required去掉变成optional, 又不是把这个字段去掉~而且dify界面也没标识必选,前后端有点不一致呢~
Author
Owner

@robin12jbj commented on GitHub (Jun 17, 2025):

dify-plugin-daemon 项目中,去掉voice字段的required规则似乎就可以了~

diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go
index 63c9f96..50a90ad 100644
--- a/pkg/entities/requests/model.go
+++ b/pkg/entities/requests/model.go
@@ -61,7 +61,7 @@ type RequestInvokeRerank struct {
 
 type InvokeTTSSchema struct {
        ContentText string `json:"content_text"  validate:"required"`
-       Voice       string `json:"voice" validate:"required"`
+       Voice       string `json:"voice"`
        TenantID    string `json:"tenant_id" validate:"required"`
 }

ChatTTS 有默认语音,dify webui 上也没有那个字段是必选的。 不过语音效果中,输入的文本可能会带来思考过程,比如 qwen 会输出<think>...</think>,在发送给 TTS 时也被成需要看到转换成语音的。 也许这里要中断断发? 图像

请问docker部署的如何修改呢?我的也是voice选择那一项无法打开

@robin12jbj commented on GitHub (Jun 17, 2025): > dify-plugin-daemon 项目中,去掉voice字段的required规则似乎就可以了~ > > ``` > diff --git a/pkg/entities/requests/model.go b/pkg/entities/requests/model.go > index 63c9f96..50a90ad 100644 > --- a/pkg/entities/requests/model.go > +++ b/pkg/entities/requests/model.go > @@ -61,7 +61,7 @@ type RequestInvokeRerank struct { > > type InvokeTTSSchema struct { > ContentText string `json:"content_text" validate:"required"` > - Voice string `json:"voice" validate:"required"` > + Voice string `json:"voice"` > TenantID string `json:"tenant_id" validate:"required"` > } > ``` > > ChatTTS 有默认语音,dify webui 上也没有那个字段是必选的。 不过语音效果中,输入的文本可能会带来思考过程,比如 qwen 会输出`<think>...</think>`,在发送给 TTS 时也被成需要看到转换成语音的。 也许这里要中断断发? <img alt="图像" width="442" src="https://private-user-images.githubusercontent.com/1576504/449770086-2ce43392-e584-409c-898e-b9cd10b1c537.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NTAyMDg5OTQsIm5iZiI6MTc1MDIwODY5NCwicGF0aCI6Ii8xNTc2NTA0LzQ0OTc3MDA4Ni0yY2U0MzM5Mi1lNTg0LTQwOWMtODk4ZS1iOWNkMTBiMWM1MzcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDYxOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTA2MThUMDEwNDU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NmQzOTUwZjI2MzAxZDE0ZmFkNzM1NzJhMWM4ZDk2M2E4ODYzNzE0YzFhOGMzYTRiZDQyMDJjZjM5Y2Y2Njk0YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.g8PeRivVBxtpUKwxzzcib4QYFVNF1gwzZ8oHaLE8VE4"> 请问docker部署的如何修改呢?我的也是voice选择那一项无法打开
Author
Owner

@yarcowang commented on GitHub (Jun 17, 2025):

@robin12jbj 修改https://github.com/langgenius/dify-plugin-daemon 对应代码, 自己build , deploy哦

@yarcowang commented on GitHub (Jun 17, 2025): @robin12jbj 修改https://github.com/langgenius/dify-plugin-daemon 对应代码, 自己build , deploy哦
Author
Owner

@dosubot[bot] commented on GitHub (Aug 21, 2025):

Hi, @chenhui-cyber. I'm Dosu, and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale.

Issue Summary

  • You reported a validation error in Dify v1.3.1's Text To Speech plugin due to a missing required 'Voice' field.
  • Commenters suggested removing the 'required' validation on the 'Voice' field since ChatTTS provides a default voice.
  • The fix involved modifying the plugin daemon code, rebuilding, and redeploying to allow the default voice usage.
  • The issue was resolved by aligning the plugin daemon validation with the web UI behavior.

Next Steps

  • Please confirm if this issue is still relevant with the latest version of dify-official-plugins.
  • If it is, you can keep the discussion open by commenting; otherwise, I will automatically close this issue in 5 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Aug 21, 2025): Hi, @chenhui-cyber. I'm [Dosu](https://dosu.dev), and I'm helping the dify-official-plugins team manage their backlog and am marking this issue as stale. **Issue Summary** - You reported a validation error in Dify v1.3.1's Text To Speech plugin due to a missing required 'Voice' field. - Commenters suggested removing the 'required' validation on the 'Voice' field since ChatTTS provides a default voice. - The fix involved modifying the plugin daemon code, rebuilding, and redeploying to allow the default voice usage. - The issue was resolved by aligning the plugin daemon validation with the web UI behavior. **Next Steps** - Please confirm if this issue is still relevant with the latest version of dify-official-plugins. - If it is, you can keep the discussion open by commenting; otherwise, I will automatically close this issue in 5 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#237