fix: err object has no attribute 'iter_lines' (#4686)

### 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>
This commit is contained in:
Kyle 2025-02-01 09:39:30 -05:00 committed by GitHub
parent 191587346c
commit 036f37a627
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1358,7 +1358,7 @@ class AnthropicChat(Base):
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