From 036f37a6276e5b7f52a87169f9b0bfe24fee966d Mon Sep 17 00:00:00 2001 From: Kyle Date: Sat, 1 Feb 2025 09:39:30 -0500 Subject: [PATCH] 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 --- rag/llm/chat_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 77f2714b9..114d7a0fe 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -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