Skip to content

Commit

Permalink
fix: stream response by line
Browse files Browse the repository at this point in the history
  • Loading branch information
jtsang4 committed May 11, 2023
1 parent 1c86e25 commit 8cfe749
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion claude_to_chatgpt/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ async def chat(self, request: Request):
if response.is_error:
raise Exception(f"Error: {response.status_code}")
prev_decoded_line = {}
async for line in response.aiter_text():
async for line in response.aiter_lines():
if line:
if line == "data: [DONE]":
yield "[DONE]"
Expand Down

0 comments on commit 8cfe749

Please sign in to comment.