You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue arises from the change in how the prefix "data:" is removed from the string. The original code chunk.strip().lstrip("data:").lstrip() removes all leading characters that are in the set of "d", "a", "t", "a", and ":", which can inadvertently strip additional characters if they appear at the start of the string. The modified code chunk.strip().removeprefix("data:") only removes the exact prefix "data:". If the chunk does not start exactly with "data:", the prefix will not be removed correctly, potentially leaving the JSON data malformed and causing a json.JSONDecodeError when attempting to parse the JSON [1].
Self Checks
Dify version
0.14.2
Cloud or Self Hosted
Self Hosted (Source)
Steps to reproduce
This change causes OpenAI-API-compatible interfaces to return all errors in the [data:] block without Spaces
✔️ Expected Behavior
Return the json data behind the correct data
❌ Actual Behavior
data json formatting error
The text was updated successfully, but these errors were encountered: