🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming
update requirements.txt and fix editor
å¼ å»ºç”Ÿ70123a79d2bd
diff --git a/metagpt/const.py b/metagpt/const.pyindex 9dc08b8d4..b47875ff7 100644--- a/metagpt/const.py+++ b/metagpt/const.py@@ -165,3 +165,6 @@ EXPERIENCE_MASK = "<experience>"# TeamLeader's nameTEAMLEADER_NAME = "Mike"++DEFAULT_MIN_TOKEN_COUNT = 10000+DEFAULT_MAX_TOKEN_COUNT = 100000000diff --git a/metagpt/tools/libs/editor.py b/metagpt/tools/libs/editor.pyindex 223216d4f..147f54f33 100644--- a/metagpt/tools/libs/editor.py+++ b/metagpt/tools/libs/editor.py@@ -13,8 +13,7 @@ from typing import List, Optional, Unionimport tiktokenfrom pydantic import BaseModel, ConfigDict-from metagpt.const import DEFAULT_WORKSPACE_ROOT-from metagpt.tools.libs.index_repo import DEFAULT_MIN_TOKEN_COUNT, IndexRepo+from metagpt.const import DEFAULT_MIN_TOKEN_COUNT, DEFAULT_WORKSPACE_ROOTfrom metagpt.tools.libs.linter import Linterfrom metagpt.tools.tool_registry import register_toolfrom metagpt.utils.common import awrite@@ -1125,7 +1124,12 @@ class Editor(BaseModel):>>> texts: List[str] = await Editor.similarity_search(query=query, path=file_or_path)>>> print(texts)"""- return await IndexRepo.cross_repo_search(query=query, file_or_path=path)+ try:+ from metagpt.tools.libs.index_repo import IndexRepo++ return await IndexRepo.cross_repo_search(query=query, file_or_path=path)+ except ImportError:+ raise ImportError("To use the similarity search, you need to install the RAG module.")@staticmethoddef is_large_file(content: str, mix_token_count: int = 0) -> bool:diff --git a/requirements.txt b/requirements.txtindex ed8965b46..5aa404e7e 100644--- a/requirements.txt+++ b/requirements.txt@@ -75,4 +75,6 @@ pygithub~=2.3htmlminfsspecgrep-ast~=0.3.3 # linter-tree-sitter~=0.21.3 # linter\ No newline at end of file+tree-sitter~=0.21.3 # linter+unidiff==0.7.5 # used at metagpt/tools/libs/cr.py+httpx==0.27.2\ No newline at end of file