Parcourir la source

fix(ch7): resolve duplicate stream print in MySimpleAgent and docs

Xinmin Zeng il y a 1 semaine
Parent
commit
2cef303ca6

+ 0 - 1
code/chapter7/my_simple_agent.py

@@ -214,7 +214,6 @@ class MySimpleAgent(SimpleAgent):
         print("📝 实时响应: ", end="")
         for chunk in self.llm.stream_invoke(messages, **kwargs):
             full_response += chunk
-            print(chunk, end="", flush=True)
             yield chunk
 
         print()  # 换行

+ 0 - 1
docs/chapter7/Chapter7-Building-Your-Agent-Framework.md

@@ -856,7 +856,6 @@ class MySimpleAgent(SimpleAgent):
         print("📝 Real-time response: ", end="")
         for chunk in self.llm.stream_invoke(messages, **kwargs):
             full_response += chunk
-            print(chunk, end="", flush=True)
             yield chunk
 
         print()  # New line

+ 0 - 1
docs/chapter7/第七章 构建你的Agent框架.md

@@ -856,7 +856,6 @@ class MySimpleAgent(SimpleAgent):
         print("📝 实时响应: ", end="")
         for chunk in self.llm.stream_invoke(messages, **kwargs):
             full_response += chunk
-            print(chunk, end="", flush=True)
             yield chunk
 
         print()  # 换行