Skip to content

Commit

Permalink
Merge pull request #1 from qbit-/master
Browse files Browse the repository at this point in the history
Fixing json decoding failure for Dify 0.6.6
  • Loading branch information
haoyuhu authored Jun 5, 2024
2 parents 246ec27 + e89e0c2 commit 0ffc784
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dify_client/_clientx.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def request_stream(self, endpoint: str, method: str,
errors.raise_for_status(event_source.response)
for sse in event_source.iter_sse():
errors.raise_for_status(sse)
if sse.data in IGNORED_STREAM_EVENTS:
if sse.event in IGNORED_STREAM_EVENTS or sse.data in IGNORED_STREAM_EVENTS:
continue
yield sse

Expand Down Expand Up @@ -434,7 +434,7 @@ async def arequest_stream(self, endpoint: str, method: str,
errors.raise_for_status(event_source.response)
async for sse in event_source.aiter_sse():
errors.raise_for_status(sse)
if sse.data in IGNORED_STREAM_EVENTS:
if sse.event in IGNORED_STREAM_EVENTS or sse.data in IGNORED_STREAM_EVENTS:
continue
yield sse

Expand Down

0 comments on commit 0ffc784

Please sign in to comment.