mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-08-30 17:34:34 +08:00
update requirements.txt and fix editor
This commit is contained in:
@@ -165,3 +165,6 @@ EXPERIENCE_MASK = "<experience>"
|
||||
|
||||
# TeamLeader's name
|
||||
TEAMLEADER_NAME = "Mike"
|
||||
|
||||
DEFAULT_MIN_TOKEN_COUNT = 10000
|
||||
DEFAULT_MAX_TOKEN_COUNT = 100000000
|
||||
|
||||
@@ -13,8 +13,7 @@ from typing import List, Optional, Union
|
||||
import tiktoken
|
||||
from 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_ROOT
|
||||
from metagpt.tools.libs.linter import Linter
|
||||
from metagpt.tools.tool_registry import register_tool
|
||||
from 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.")
|
||||
|
||||
@staticmethod
|
||||
def is_large_file(content: str, mix_token_count: int = 0) -> bool:
|
||||
|
||||
+3
-1
@@ -75,4 +75,6 @@ pygithub~=2.3
|
||||
htmlmin
|
||||
fsspec
|
||||
grep-ast~=0.3.3 # linter
|
||||
tree-sitter~=0.21.3 # linter
|
||||
tree-sitter~=0.21.3 # linter
|
||||
unidiff==0.7.5 # used at metagpt/tools/libs/cr.py
|
||||
httpx==0.27.2
|
||||
Reference in New Issue
Block a user