🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
fixbug: circular import
莘权 马f365b1f33f81
diff --git a/metagpt/provider/base_llm.py b/metagpt/provider/base_llm.pyindex 75d8bfe00..f9111ffe0 100644--- a/metagpt/provider/base_llm.py+++ b/metagpt/provider/base_llm.py@@ -27,7 +27,6 @@ from metagpt.configs.llm_config import LLMConfigfrom metagpt.const import IMAGES, LLM_API_TIMEOUT, USE_CONFIG_TIMEOUTfrom metagpt.logs import loggerfrom metagpt.provider.constant import MULTI_MODAL_MODELS-from metagpt.schema import Messagefrom metagpt.utils.common import log_and_reraisefrom metagpt.utils.cost_manager import CostManager, Costsfrom metagpt.utils.token_counter import TOKEN_MAX@@ -80,7 +79,7 @@ class BaseLLM(ABC):def support_image_input(self) -> bool:return any([m in self.config.model for m in MULTI_MODAL_MODELS])- def format_msg(self, messages: Union[str, Message, list[dict], list[Message], list[str]]) -> list[dict]:+ def format_msg(self, messages: Union[str, "Message", list[dict], list["Message"], list[str]]) -> list[dict]:"""convert messages to list[dict]."""from metagpt.schema import Message@@ -173,7 +172,9 @@ class BaseLLM(ABC):context.append(self._assistant_msg(rsp_text))return self._extract_assistant_rsp(context)- async def aask_code(self, messages: Union[str, Message, list[dict]], timeout=USE_CONFIG_TIMEOUT, **kwargs) -> dict:+ async def aask_code(+ self, messages: Union[str, "Message", list[dict]], timeout=USE_CONFIG_TIMEOUT, **kwargs+ ) -> dict:raise NotImplementedError@abstractmethoddiff --git a/metagpt/tools/libs/index_repo.py b/metagpt/tools/libs/index_repo.pyindex 720fec4fd..cf41c2e9c 100644--- a/metagpt/tools/libs/index_repo.py+++ b/metagpt/tools/libs/index_repo.py@@ -1,5 +1,6 @@#!/usr/bin/env python# -*- coding: utf-8 -*-+import jsonfrom pathlib import Pathfrom typing import Dict, List, Optional, Set, Union