Skip to content

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

update provider uniform name and check tests

better6295fc820795019
diff --git a/tests/metagpt/provider/test_fireworks_api.py b/tests/metagpt/provider/test_fireworks_api.py
index d9c946ef7..496465e5f 100644
--- a/tests/metagpt/provider/test_fireworks_api.py
+++ b/tests/metagpt/provider/test_fireworks_api.py
@@ -10,12 +10,12 @@ from openai.types.chat.chat_completion import (
)
from openai.types.completion_usage import CompletionUsage
+from metagpt.config import CONFIG
from metagpt.provider.fireworks_api import (
MODEL_GRADE_TOKEN_COSTS,
FireworksCostManager,
FireworksLLM,
)
-from metagpt.config import CONFIG
CONFIG.fireworks_api_key = "xxx"
@@ -26,7 +26,12 @@ default_resp = ChatCompletion(
object="chat.completion",
created=1703300855,
choices=[
- Choice(finish_reason="stop", index=0, message=ChatCompletionMessage(role="assistant", content=resp_content), logprobs=None)
+ Choice(
+ finish_reason="stop",
+ index=0,
+ message=ChatCompletionMessage(role="assistant", content=resp_content),
+ logprobs=None,
+ )
],
usage=CompletionUsage(completion_tokens=110, prompt_tokens=92, total_tokens=202),
)
diff --git a/tests/metagpt/provider/test_zhipuai_api.py b/tests/metagpt/provider/test_zhipuai_api.py
index 29cfe2eb3..c1af2f0be 100644
--- a/tests/metagpt/provider/test_zhipuai_api.py
+++ b/tests/metagpt/provider/test_zhipuai_api.py
@@ -32,9 +32,7 @@ async def mock_llm_achat_completion_stream(self, messgaes: list[dict]) -> str:
async def test_zhipuai_acompletion(mocker):
mocker.patch("metagpt.provider.zhipuai_api.ZhiPuAILLM.acompletion", mock_llm_acompletion)
mocker.patch("metagpt.provider.zhipuai_api.ZhiPuAILLM._achat_completion", mock_llm_acompletion)
- mocker.patch(
- "metagpt.provider.zhipuai_api.ZhiPuAILLM._achat_completion_stream", mock_llm_achat_completion_stream
- )
+ mocker.patch("metagpt.provider.zhipuai_api.ZhiPuAILLM._achat_completion_stream", mock_llm_achat_completion_stream)
zhipu_gpt = ZhiPuAILLM()
resp = await zhipu_gpt.acompletion(messages)