simplify code

This commit is contained in:
better629 2025-03-01 18:00:30 +08:00
parent 119385c5ce
commit cc774db7b3
4 changed files with 19 additions and 17 deletions

View file

@ -13,7 +13,9 @@ 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])
rsp = await llm.aask(question, system_msgs=[system_prompt], stream=True)
if llm.reasoning_content:
logger.info(f"A reasoning: {llm.reasoning_content}")
logger.info(f"A: {rsp}")
return rsp