From edff9b284228995477f37ae0f6accc270b78f92a Mon Sep 17 00:00:00 2001 From: better629 Date: Thu, 13 Mar 2025 14:22:02 +0800 Subject: [PATCH] hello_world example compatibility --- examples/hello_world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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