mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-08 07:12:38 +02:00
insight pool is now able to dynamically increase
This commit is contained in:
parent
ae12d73747
commit
56e7a08a1c
3 changed files with 20 additions and 13 deletions
|
|
@ -2,6 +2,7 @@ import json
|
|||
import os
|
||||
import random
|
||||
|
||||
from expo.insights.solution_designer import SolutionDesigner
|
||||
from expo.utils import clean_json_from_rsp, load_data_config, mcts_logger
|
||||
from metagpt.llm import LLM
|
||||
from metagpt.schema import Message
|
||||
|
|
@ -32,6 +33,12 @@ DATA_CONFIG = load_data_config()
|
|||
class InstructionGenerator:
|
||||
data_config = DATA_CONFIG
|
||||
|
||||
def __init__(self, file_path, use_fixed_insights=False):
|
||||
self.file_path = file_path
|
||||
self.use_fixed_insights = use_fixed_insights
|
||||
self.analysis_pool = self.load_analysis_pool(file_path, use_fixed_insights)
|
||||
self.proposer = SolutionDesigner()
|
||||
|
||||
@staticmethod
|
||||
def load_json_data(json_dir):
|
||||
with open(json_dir, "r") as file:
|
||||
|
|
@ -83,13 +90,8 @@ class InstructionGenerator:
|
|||
data = [item for item in data if int(item["task_id"]) == int(task_id)]
|
||||
return data
|
||||
|
||||
@staticmethod
|
||||
async def generate_new_instructions(
|
||||
task_id, original_instruction, max_num, file_path, ext_info=None, use_fixed_insights=False
|
||||
):
|
||||
data = InstructionGenerator.load_analysis_pool(
|
||||
file_path, task_id=task_id, use_fixed_insights=use_fixed_insights
|
||||
)
|
||||
async def generate_new_instructions(self, task_id, original_instruction, max_num, ext_info=None):
|
||||
data = self.analysis_pool
|
||||
new_instructions = []
|
||||
if len(data) == 0:
|
||||
mcts_logger.log("MCTS", f"No insights available for task {task_id}")
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ The insights should be proposed based on the dataset description with different
|
|||
Each task type should have at least 5 insights.
|
||||
Make sure each method is diverse enough and can be implemented separately.
|
||||
Be specific about models' choices, ensemble and tuning techniques, and preprocessing & feature engineering techniques.
|
||||
Your model choices should be advanced enough to be helpful.
|
||||
|
||||
# Format
|
||||
```json
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue