Skip to content

Commit

Permalink
fix(sse): small improvement to handling server-sent events (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-bot committed Jun 19, 2023
1 parent 11b2ebb commit 05796db
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/finch/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ def _process_response_data(

def _process_stream_line(self, contents: str) -> str:
"""Pre-process an indiviudal line from a streaming response"""
if contents == "data: [DONE]\n":
if contents.startswith("data: [DONE]"):
raise StopStreaming()

if contents.startswith("data: "):
Expand Down

0 comments on commit 05796db

Please sign in to comment.