Bläddra i källkod

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>
tags/v0.16.0
Kyle 9 månader sedan
förälder
incheckning
036f37a627
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1
    1
      rag/llm/chat_model.py

+ 1
- 1
rag/llm/chat_model.py Visa fil

@@ -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

Laddar…
Avbryt
Spara