Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

fix(chat_agent): make `StreamingChatAgentResponse.__iter__` yield stored responses when already consumed (#3083)

Lei Zhang744be31900b0
diff --git a/camel/agents/chat_agent.py b/camel/agents/chat_agent.py
index 82499716a..77b714b30 100644
--- a/camel/agents/chat_agent.py
+++ b/camel/agents/chat_agent.py
@@ -233,7 +233,7 @@ class StreamingChatAgentResponse:
r"""Make this object iterable."""
if self._consumed:
# If already consumed, iterate over stored responses
- return iter(self._responses)
+ yield from self._responses
else:
# If not consumed, consume and yield
try: