mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-05 16:02:14 +02:00
chore: 修复单测依赖问题(忽略安卓单测)
This commit is contained in:
parent
0c2b7dad3d
commit
20b3623536
6 changed files with 40 additions and 36 deletions
|
|
@ -10,9 +10,9 @@ from typing import Optional
|
|||
|
||||
from pydantic import field_validator
|
||||
|
||||
from metagpt.const import LLM_API_TIMEOUT
|
||||
from metagpt.const import CONFIG_ROOT, LLM_API_TIMEOUT, METAGPT_ROOT
|
||||
from metagpt.utils.yaml_model import YamlModel
|
||||
from metagpt.const import METAGPT_ROOT, CONFIG_ROOT
|
||||
|
||||
|
||||
class LLMType(Enum):
|
||||
OPENAI = "openai"
|
||||
|
|
@ -97,12 +97,13 @@ class LLMConfig(YamlModel):
|
|||
repo_config_path = METAGPT_ROOT / "config/config2.yaml"
|
||||
root_config_path = CONFIG_ROOT / "config2.yaml"
|
||||
if root_config_path.exists():
|
||||
raise ValueError(
|
||||
f"Please set your API key in {root_config_path}. If you also set your config in {repo_config_path}, \nthe former will overwrite the latter. This may cause unexpected result.\n")
|
||||
raise ValueError(
|
||||
f"Please set your API key in {root_config_path}. If you also set your config in {repo_config_path}, \nthe former will overwrite the latter. This may cause unexpected result.\n"
|
||||
)
|
||||
elif repo_config_path.exists():
|
||||
raise ValueError(f"Please set your API key in {repo_config_path}")
|
||||
else:
|
||||
raise ValueError(f"Please set your API key in config2.yaml")
|
||||
raise ValueError("Please set your API key in config2.yaml")
|
||||
return v
|
||||
|
||||
@field_validator("timeout")
|
||||
|
|
|
|||
|
|
@ -58,7 +58,9 @@ class Researcher(Role):
|
|||
)
|
||||
elif isinstance(todo, WebBrowseAndSummarize):
|
||||
links = instruct_content.links
|
||||
todos = (todo.run(*url, query=query, system_text=research_system_text) for (query, url) in links.items() if url)
|
||||
todos = (
|
||||
todo.run(*url, query=query, system_text=research_system_text) for (query, url) in links.items() if url
|
||||
)
|
||||
if self.enable_concurrency:
|
||||
summaries = await asyncio.gather(*todos)
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ from multiprocessing import Pipe
|
|||
|
||||
|
||||
class StreamPipe:
|
||||
def __init__(self,name=None):
|
||||
def __init__(self, name=None):
|
||||
self.name = name
|
||||
self.parent_conn, self.child_conn = Pipe()
|
||||
self.finish: bool = False
|
||||
|
|
|
|||
|
|
@ -226,8 +226,8 @@ TOKEN_MAX = {
|
|||
"claude-2.1": 200000,
|
||||
"claude-3-sonnet-20240229": 200000,
|
||||
"claude-3-opus-20240229": 200000,
|
||||
"claude-3-5-sonnet-20240620":200000,
|
||||
"claude-3-haiku-20240307":200000,
|
||||
"claude-3-5-sonnet-20240620": 200000,
|
||||
"claude-3-haiku-20240307": 200000,
|
||||
"yi-34b-chat-0205": 4000,
|
||||
"yi-34b-chat-200k": 200000,
|
||||
"yi-large": 16385,
|
||||
|
|
@ -263,7 +263,6 @@ TOKEN_MAX = {
|
|||
"qwen-7b-chat": 32000,
|
||||
"qwen-1.8b-longcontext-chat": 32000,
|
||||
"qwen-1.8b-chat": 8000,
|
||||
|
||||
}
|
||||
|
||||
# For Amazon Bedrock US region
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue