mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-27 17:56:23 +02:00
tool management at one place, add aask_code mock, azure mock
This commit is contained in:
parent
9e0b9745be
commit
e99c5f29f4
9 changed files with 167 additions and 74 deletions
|
|
@ -9,6 +9,16 @@
|
|||
|
||||
from enum import Enum
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from metagpt.const import TOOL_SCHEMA_PATH
|
||||
from metagpt.prompts.tool_type import (
|
||||
DATA_PREPROCESS_PROMPT,
|
||||
FEATURE_ENGINEERING_PROMPT,
|
||||
MODEL_TRAIN_PROMPT,
|
||||
MODEL_EVALUATE_PROMPT,
|
||||
)
|
||||
|
||||
|
||||
class SearchEngineType(Enum):
|
||||
SERPAPI_GOOGLE = "serpapi"
|
||||
|
|
@ -27,3 +37,44 @@ class WebBrowserEngineType(Enum):
|
|||
def __missing__(cls, key):
|
||||
"""Default type conversion"""
|
||||
return cls.CUSTOM
|
||||
|
||||
|
||||
class ToolType(BaseModel):
|
||||
name: str
|
||||
module: str = ""
|
||||
desc: str
|
||||
usage_prompt: str = ""
|
||||
|
||||
|
||||
TOOL_TYPE_MAPPINGS = {
|
||||
"data_preprocess": ToolType(
|
||||
name="data_preprocess",
|
||||
module=str(TOOL_SCHEMA_PATH / "data_preprocess"),
|
||||
desc="Only for changing value inplace.",
|
||||
usage_prompt=DATA_PREPROCESS_PROMPT,
|
||||
),
|
||||
"feature_engineering": ToolType(
|
||||
name="feature_engineering",
|
||||
module=str(TOOL_SCHEMA_PATH / "feature_engineering"),
|
||||
desc="Only for creating new columns for input data.",
|
||||
usage_prompt=FEATURE_ENGINEERING_PROMPT,
|
||||
),
|
||||
"model_train": ToolType(
|
||||
name="model_train",
|
||||
module="",
|
||||
desc="Only for training model.",
|
||||
usage_prompt=MODEL_TRAIN_PROMPT,
|
||||
),
|
||||
"model_evaluate": ToolType(
|
||||
name="model_evaluate",
|
||||
module="",
|
||||
desc="Only for evaluating model.",
|
||||
usage_prompt=MODEL_EVALUATE_PROMPT,
|
||||
),
|
||||
"other": ToolType(
|
||||
name="other",
|
||||
module="",
|
||||
desc="Any tasks that do not fit into the previous categories",
|
||||
usage_prompt="",
|
||||
),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue