🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
feat: merge teacher
莘权 马01c487fb6a2f
diff --cc metagpt/provider/openai_api.pyindex f0b692f46,40aa3848e..3baf8d932--- a/metagpt/provider/openai_api.py+++ b/metagpt/provider/openai_api.py@@@ -8,11 -8,10 +8,12 @@@"""import asyncioimport time- from typing import NamedTuple, Dict++ from typing import NamedTuple+ import tracebackimport openaifrom openai.error import APIConnectionError+from pydantic import BaseModelfrom tenacity import retry, stop_after_attempt, after_log, wait_fixed, retry_if_exception_typefrom metagpt.logs import loggerdiff --cc tests/metagpt/actions/test_write_code.pyindex 9861fd4cd,3480734e0..d53e37243--- a/tests/metagpt/actions/test_write_code.py+++ b/tests/metagpt/actions/test_write_code.py@@@ -19,11 -20,10 +20,10 @@@ from tests.metagpt.actions.mock importasync def test_write_code():api_design = "设计一个名为'add'的函数,该函数接受两个整数作为输入,并返回它们的和。"conf = Config()- cost_manager = CostManager(conf.runtime_options)+ cost_manager = CostManager(**conf.runtime_options)llm = LLM(options=conf.runtime_options, cost_manager=cost_manager)write_code = WriteCode(options=conf.runtime_options, name="write_code", llm=llm)-- code = await write_code.run(api_design, "filename")+ code = await write_code.run(context=api_design, filename="test")logger.info(code)# 我们不能精确地预测生成的代码,但我们可以检查某些关键字