Merge pull request #1760 from better629/main

hello_world example compatibility
This commit is contained in:
better629 2025-03-13 14:22:42 +08:00 committed by GitHub
commit 79390a2824
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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