diff --git a/metagpt/environment/mgx/mgx_env.py b/metagpt/environment/mgx/mgx_env.py index 33160cfd8..69f80c2ff 100644 --- a/metagpt/environment/mgx/mgx_env.py +++ b/metagpt/environment/mgx/mgx_env.py @@ -27,7 +27,7 @@ class MGXEnv(Environment): def publish_message(self, message: Message, user_defined_recipient: str = "", publicer: str = "") -> bool: """let the team leader take over message publishing""" - tl = self.get_role("Tim") # TeamLeader's name is Tim + tl = self.get_role("Mike") # TeamLeader's name is Mike if user_defined_recipient: # human user's direct chat message to a certain role diff --git a/metagpt/tools/libs/browser.py b/metagpt/tools/libs/browser.py index 072eebde1..4a6d13eec 100644 --- a/metagpt/tools/libs/browser.py +++ b/metagpt/tools/libs/browser.py @@ -121,7 +121,7 @@ class Browser: await scroll_page(self.page, direction) return await self._wait_page() - async def goto(self, url: str, timeout: float = 30000): + async def goto(self, url: str, timeout: float = 90000): """Navigate to a specific URL.""" if self.page is None: await self.start() diff --git a/metagpt/tools/libs/terminal.py b/metagpt/tools/libs/terminal.py index a736d476a..b54adf0d4 100644 --- a/metagpt/tools/libs/terminal.py +++ b/metagpt/tools/libs/terminal.py @@ -115,8 +115,9 @@ class Terminal: # '\r' is changed to '\n', resulting in excessive output. tmp = b"" while True: - self.process.communicate() output = tmp + await self.process.stdout.read(1) + if not output: + continue *lines, tmp = output.splitlines(True) for line in lines: line = line.decode() diff --git a/metagpt/utils/token_counter.py b/metagpt/utils/token_counter.py index 63e2f8736..f6440b6ef 100644 --- a/metagpt/utils/token_counter.py +++ b/metagpt/utils/token_counter.py @@ -31,9 +31,9 @@ TOKEN_COSTS = { "gpt-4-0125-preview": {"prompt": 0.01, "completion": 0.03}, "gpt-4-1106-preview": {"prompt": 0.01, "completion": 0.03}, "gpt-4-vision-preview": {"prompt": 0.01, "completion": 0.03}, # TODO add extra image price calculator - "gpt-4-1106-vision-preview": {"prompt": 0.01, "completion": 0.03}, "gpt-4o": {"prompt": 0.005, "completion": 0.015}, "gpt-4o-2024-05-13": {"prompt": 0.005, "completion": 0.015}, + "gpt-4-1106-vision-preview": {"prompt": 0.01, "completion": 0.03}, "text-embedding-ada-002": {"prompt": 0.0004, "completion": 0.0}, "glm-3-turbo": {"prompt": 0.0007, "completion": 0.0007}, # 128k version, prompt + completion tokens=0.005¥/k-tokens "glm-4": {"prompt": 0.014, "completion": 0.014}, # 128k version, prompt + completion tokens=0.1¥/k-tokens @@ -147,6 +147,8 @@ FIREWORKS_GRADE_TOKEN_COSTS = { # https://platform.openai.com/docs/models/gpt-4-and-gpt-4-turbo TOKEN_MAX = { + "gpt-4o-2024-05-13": 128000, + "gpt-4o": 128000, "gpt-4-0125-preview": 128000, "gpt-4-turbo-preview": 128000, "gpt-4-1106-preview": 128000,