langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
46.76k stars 6.61k forks source link

event: tts_message_end always return in api streaming response_mode #8843

Open xmenw opened 1 day ago

xmenw commented 1 day ago

Self Checks

Dify version

0.8.3

Cloud or Self Hosted

Cloud

Steps to reproduce

curl --location 'https://api.dify.ai/v1/chat-messages' \ --header 'Authorization: Bearer app-PqAVQAqIr7VJgxQTN3pIa9Oe' \ --header 'Content-Type: application/json' \ --data '{ "inputs": {}, "query": "What are the specs of the iPhone 13 Pro Max?", "response_mode": "streaming", "conversation_id": "", "user": "abc-123" }'

image

✔️ Expected Behavior

This parameter is not returned if text_to_speech is not configured and disable is enabled

❌ Actual Behavior

image

dosubot[bot] commented 1 day ago

Hey @xmenw! I'm here to help you with any bugs, questions, or contributions you have for Dify. I can assist you while you wait for a human maintainer. Ask me anything!

The "tts_message_end" event always returns in the API streaming response_mode even when text_to_speech is not configured and disabled because it is a predefined event in the streaming response structure. This event is used to indicate the end of the audio stream, and its presence in the response does not depend on the actual configuration of text_to_speech [1].

To continue talking to Dosu, mention @dosu.

crazywoola commented 1 day ago

@ic-xu Could you take a look at this.

ic-xu commented 1 day ago

@ic-xu你能看看这个吗?

OK, I'll just filter it.

ic-xu commented 1 day ago

PR. https://github.com/langgenius/dify/pull/8846