mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +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
|
|
@ -54,11 +54,7 @@ Please assign a task type to each task in the list below from the given categori
|
|||
{task_list}
|
||||
|
||||
## All Task Type:
|
||||
- **feature_engineering**: Only for creating new columns for input data.
|
||||
- **data_preprocess**: Only for changing value inplace.
|
||||
- **model_train**: Only for training model.
|
||||
- **model_evaluate**: Only for evaluating model.
|
||||
- **other**: Any tasks that do not fit into the previous categories, such as visualization, summarizing findings, etc.
|
||||
{task_type_desc}
|
||||
"""
|
||||
|
||||
ASSIGN_TASK_TYPE_CONFIG = {
|
||||
|
|
@ -278,52 +274,3 @@ for col in num_cols:
|
|||
- The output code should contain all steps implemented correctly in 'Code Steps'.
|
||||
"""
|
||||
# - If 'Code Steps' contains step done in 'Done Tasks', such as reading data, don't repeat it.
|
||||
|
||||
DATA_PREPROCESS_PROMPT = """
|
||||
The current task is about data preprocessing, please note the following:
|
||||
- Monitor data types per column, applying appropriate methods.
|
||||
- Ensure operations are on existing dataset columns.
|
||||
- Avoid writing processed data to files.
|
||||
- Avoid any change to label column, such as standardization, etc.
|
||||
- Prefer alternatives to one-hot encoding for categorical data.
|
||||
- Only encode or scale necessary columns to allow for potential feature-specific engineering tasks (like time_extract, binning, extraction, etc.) later.
|
||||
- Each step do data preprocessing to train, must do same for test separately at the same time.
|
||||
"""
|
||||
|
||||
FEATURE_ENGINEERING_PROMPT = """
|
||||
The current task is about feature engineering. when performing it, please adhere to the following principles:
|
||||
- Generate as diverse features as possible to improve the model's performance step-by-step.
|
||||
- If potential impactful features are not included in 'Code Steps', add new steps to generate them.
|
||||
- Avoid creating redundant or excessively numerous features in one step.
|
||||
- Exclude ID columns from feature generation and remove them.
|
||||
- Each step do feature engineering to train, must do same for test separately at the same time.
|
||||
- Avoid using the label column to create features, except for cat encoding.
|
||||
- Use the data from previous task result if exist, do not mock or reload data yourself.
|
||||
"""
|
||||
|
||||
MODEL_TRAIN_PROMPT = """
|
||||
The current task is about training a model, please ensure high performance:
|
||||
- Keep in mind that your user prioritizes results and is highly focused on model performance. So, when needed, feel free to use models of any complexity to improve effectiveness, such as lightGBM, XGBoost, CatBoost, etc.
|
||||
- If non-numeric columns exist, perform label encode together with all steps.
|
||||
- Use the data from previous task result directly, do not mock or reload data yourself.
|
||||
- Set suitable hyperparameters for the model, make metrics as high as possible.
|
||||
"""
|
||||
|
||||
MODEL_EVALUATE_PROMPT = """
|
||||
The current task is about evaluating a model, please note the following:
|
||||
- Ensure that the evaluated data is same processed as the training data. If not, remember use object in 'Done Tasks' to transform the data.
|
||||
- Use trained model from previous task result directly, do not mock or reload model yourself.
|
||||
"""
|
||||
|
||||
TASK_SPECIFIC_PROMPT = {
|
||||
"data_preprocess": DATA_PREPROCESS_PROMPT,
|
||||
"feature_engineering": FEATURE_ENGINEERING_PROMPT,
|
||||
"model_train": MODEL_TRAIN_PROMPT,
|
||||
"model_evaluate": MODEL_EVALUATE_PROMPT,
|
||||
}
|
||||
|
||||
TASK_MODULE_MAP = {
|
||||
"data_preprocess": "metagpt.tools.functions.libs.data_preprocess",
|
||||
"feature_engineering": "metagpt.tools.functions.libs.feature_engineering",
|
||||
"udf": "metagpt.tools.functions.libs.udf",
|
||||
}
|
||||
|
|
|
|||
35
metagpt/prompts/tool_type.py
Normal file
35
metagpt/prompts/tool_type.py
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
DATA_PREPROCESS_PROMPT = """
|
||||
The current task is about data preprocessing, please note the following:
|
||||
- Monitor data types per column, applying appropriate methods.
|
||||
- Ensure operations are on existing dataset columns.
|
||||
- Avoid writing processed data to files.
|
||||
- Avoid any change to label column, such as standardization, etc.
|
||||
- Prefer alternatives to one-hot encoding for categorical data.
|
||||
- Only encode or scale necessary columns to allow for potential feature-specific engineering tasks (like time_extract, binning, extraction, etc.) later.
|
||||
- Each step do data preprocessing to train, must do same for test separately at the same time.
|
||||
"""
|
||||
|
||||
FEATURE_ENGINEERING_PROMPT = """
|
||||
The current task is about feature engineering. when performing it, please adhere to the following principles:
|
||||
- Generate as diverse features as possible to improve the model's performance step-by-step.
|
||||
- If potential impactful features are not included in 'Code Steps', add new steps to generate them.
|
||||
- Avoid creating redundant or excessively numerous features in one step.
|
||||
- Exclude ID columns from feature generation and remove them.
|
||||
- Each step do feature engineering to train, must do same for test separately at the same time.
|
||||
- Avoid using the label column to create features, except for cat encoding.
|
||||
- Use the data from previous task result if exist, do not mock or reload data yourself.
|
||||
"""
|
||||
|
||||
MODEL_TRAIN_PROMPT = """
|
||||
The current task is about training a model, please ensure high performance:
|
||||
- Keep in mind that your user prioritizes results and is highly focused on model performance. So, when needed, feel free to use models of any complexity to improve effectiveness, such as lightGBM, XGBoost, CatBoost, etc.
|
||||
- If non-numeric columns exist, perform label encode together with all steps.
|
||||
- Use the data from previous task result directly, do not mock or reload data yourself.
|
||||
- Set suitable hyperparameters for the model, make metrics as high as possible.
|
||||
"""
|
||||
|
||||
MODEL_EVALUATE_PROMPT = """
|
||||
The current task is about evaluating a model, please note the following:
|
||||
- Ensure that the evaluated data is same processed as the training data. If not, remember use object in 'Done Tasks' to transform the data.
|
||||
- Use trained model from previous task result directly, do not mock or reload model yourself.
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue