Skip to content

Commit

Permalink
fix: err object has no attribute 'iter_lines' (#4686)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

ERROR: 'Stream' object has no attribute 'iter_lines' with reference to
Claude/Anthropic chat streams

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Co-authored-by: Kyle Olmstead <k.olmstead@offensive-security.com>
  • Loading branch information
KyTiXo and Kyle Olmstead authored Feb 1, 2025
1 parent 1915873 commit 036f37a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rag/llm/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1358,7 +1358,7 @@ def chat_streamly(self, system, history, gen_conf):
stream=True,
**gen_conf,
)
for res in response.iter_lines():
for res in response:
if res.type == 'content_block_delta':
text = res.delta.text
ans += text
Expand Down

0 comments on commit 036f37a

Please sign in to comment.