Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

feat: merge main

莘权 马f19fcfa2df45
diff --cc metagpt/actions/design_api_an.py
index 5977cbd95,cffb09c76..ca7aea95a
--- a/metagpt/actions/design_api_an.py
+++ b/metagpt/actions/design_api_an.py
@@@ -5,7 -5,7 +5,7 @@@
@Author : alexanderwu
@File : design_api_an.py
"""
- from typing import List
-from typing import List,Optional
++from typing import List, Optional
from metagpt.actions.action_node import ActionNode
from metagpt.utils.mermaid import MMC1, MMC2
@@@ -45,9 -45,10 +45,10 @@@ REFINED_FILE_LIST = ActionNode
example=["main.py", "game.py", "new_feature.py"],
)
-#optional,because low success reproduction of class diagram in non py project.
++# optional,because low success reproduction of class diagram in non py project.
DATA_STRUCTURES_AND_INTERFACES = ActionNode(
key="Data structures and interfaces",
- expected_type=str,
+ expected_type=Optional[str],
instruction="Use mermaid classDiagram code syntax, including classes, method(__init__ etc.) and functions with type"
" annotations, CLEARLY MARK the RELATIONSHIPS between classes, and comply with PEP8 standards. "
"The data structures SHOULD BE VERY DETAILED and the API should be comprehensive with a complete design.",
diff --cc metagpt/utils/token_counter.py
index a99d351f7,fda19cdba..4643b0829
--- a/metagpt/utils/token_counter.py
+++ b/metagpt/utils/token_counter.py
@@@ -33,7 -40,7 +40,8 @@@ TOKEN_COSTS =
"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-mini": {"prompt": 0.00015, "completion": 0.0006},
+ "gpt-4o-2024-05-13": {"prompt": 0.005, "completion": 0.015},
"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
@@@ -156,8 -202,6 +203,7 @@@ TOKEN_MAX =
"gpt-4-0613": 8192,
"gpt-4-32k": 32768,
"gpt-4-32k-0613": 32768,
+ "gpt-4o-mini": 128000,
- "gpt-4o": 128000,
"gpt-3.5-turbo-0125": 16385,
"gpt-3.5-turbo": 16385,
"gpt-3.5-turbo-1106": 16385,
@@@ -206,13 -341,14 +343,15 @@@ def count_input_tokens(messages, model=
"gpt-4-32k-0314",
"gpt-4-0613",
"gpt-4-32k-0613",
+ "gpt-4-turbo",
"gpt-4-turbo-preview",
"gpt-4-0125-preview",
- "gpt-4-1106-preview",
+ "gpt-4-turbo",
"gpt-4-vision-preview",
"gpt-4-1106-vision-preview",
- "gpt-4o-2024-05-13",
"gpt-4o",
++ "gpt-4o-2024-05-13",
+ "gpt-4o-mini",
}:
tokens_per_message = 3 # # every reply is primed with <|start|>assistant<|message|>
tokens_per_name = 1