Skip to content

Commit

Permalink
fix stream response (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZingLix authored Jan 10, 2024
1 parent eb1e8ce commit 91c7c6d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/qianfan/common/client/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,8 @@ def chat_in_terminal(self) -> None:
response = self.client.do(messages=messages, stream=True)
s = ""
for resp in response:
if not resp["is_end"]:
s += resp["result"]
live.update(Markdown(s), refresh=True)
s += resp["result"]
live.update(Markdown(s), refresh=True)
messages.append(s, role=QfRole.Assistant)
rprint()

Expand Down

0 comments on commit 91c7c6d

Please sign in to comment.