Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

feat: merge teacher

莘权 马01c487fb6a2f
diff --cc metagpt/provider/openai_api.py
index f0b692f46,40aa3848e..3baf8d932
--- a/metagpt/provider/openai_api.py
+++ b/metagpt/provider/openai_api.py
@@@ -8,11 -8,10 +8,12 @@@
"""
import asyncio
import time
- from typing import NamedTuple, Dict
+
+ from typing import NamedTuple
+ import traceback
import openai
from openai.error import APIConnectionError
+from pydantic import BaseModel
from tenacity import retry, stop_after_attempt, after_log, wait_fixed, retry_if_exception_type
from metagpt.logs import logger
diff --cc tests/metagpt/actions/test_write_code.py
index 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 import
async 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)
# 我们不能精确地预测生成的代码,但我们可以检查某些关键字