🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
fix dashcope spell
betterwang2d17da282622
diff --git a/metagpt/provider/dashscope_api.py b/metagpt/provider/dashscope_api.pyindex c02a302e4..7d7dcb7b7 100644--- a/metagpt/provider/dashscope_api.py+++ b/metagpt/provider/dashscope_api.py@@ -37,7 +37,7 @@ from metagpt.provider.base_llm import BaseLLM, LLMConfigfrom metagpt.provider.llm_provider_registry import LLMType, register_providerfrom metagpt.provider.openai_api import log_and_reraisefrom metagpt.utils.cost_manager import CostManager-from metagpt.utils.token_counter import DashScore_TOKEN_COSTS+from metagpt.utils.token_counter import DashScope_TOKEN_COSTSdef build_api_arequest(@@ -167,7 +167,7 @@ class DashScopeLLM(BaseLLM):def __init_dashscope(self):self.model = self.config.modelself.api_key = self.config.api_key- self.token_costs = DashScore_TOKEN_COSTS+ self.token_costs = DashScope_TOKEN_COSTSself.aclient: AGeneration = AGeneration# check support system_message modelsdiff --git a/metagpt/utils/token_counter.py b/metagpt/utils/token_counter.pyindex 53dc9e9c7..220014d8f 100644--- a/metagpt/utils/token_counter.py+++ b/metagpt/utils/token_counter.py@@ -91,10 +91,10 @@ QianFan_EndPoint_TOKEN_COSTS = {}"""-DashScore Token price https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billing+DashScope Token price https://help.aliyun.com/zh/dashscope/developer-reference/tongyi-thousand-questions-metering-and-billingDifferent model has different detail page. Attention, some model are free for a limited time."""-DashScore_TOKEN_COSTS = {+DashScope_TOKEN_COSTS = {"qwen-turbo": {"prompt": 0.0011, "completion": 0.0011},"qwen-plus": {"prompt": 0.0028, "completion": 0.0028},"qwen-max": {"prompt": 0.0, "completion": 0.0},diff --git a/tests/metagpt/provider/test_dashscope_api.py b/tests/metagpt/provider/test_dashscope_api.pyindex df6e92af0..a6dd8f247 100644--- a/tests/metagpt/provider/test_dashscope_api.py+++ b/tests/metagpt/provider/test_dashscope_api.py@@ -62,12 +62,12 @@ async def test_dashscope_acompletion(mocker):mocker.patch("dashscope.aigc.generation.Generation.call", mock_dashscope_call)mocker.patch("metagpt.provider.dashscope_api.AGeneration.acall", mock_dashscope_acall)- dashscore_llm = DashScopeLLM(mock_llm_config_dashscope)+ dashscope_llm = DashScopeLLM(mock_llm_config_dashscope)- resp = dashscore_llm.completion(messages)+ resp = dashscope_llm.completion(messages)assert resp.choices[0]["message"]["content"] == resp_cont- resp = await dashscore_llm.acompletion(messages)+ resp = await dashscope_llm.acompletion(messages)assert resp.choices[0]["message"]["content"] == resp_cont- await llm_general_chat_funcs_test(dashscore_llm, prompt, messages, resp_cont)+ await llm_general_chat_funcs_test(dashscope_llm, prompt, messages, resp_cont)