diff --git a/examples/hello_world.py b/examples/hello_world.py index 5c1082353..641ac0dcf 100644 --- a/examples/hello_world.py +++ b/examples/hello_world.py @@ -14,7 +14,7 @@ from metagpt.logs import logger async def ask_and_print(question: str, llm: LLM, system_prompt) -> str: logger.info(f"Q: {question}") rsp = await llm.aask(question, system_msgs=[system_prompt], stream=True) - if llm.reasoning_content: + if hasattr(llm, "reasoning_content") and llm.reasoning_content: logger.info(f"A reasoning: {llm.reasoning_content}") logger.info(f"A: {rsp}") return rsp