Update autotabml_agents.py
Browse files- autotabml_agents.py +90 -90
autotabml_agents.py
CHANGED
@@ -1,90 +1,90 @@
|
|
1 |
-
from crewai import Agent
|
2 |
-
from crewai_tools import FileReadTool
|
3 |
-
|
4 |
-
|
5 |
-
# Function to initialize agents
|
6 |
-
def initialize_agents(llm,file_name):
|
7 |
-
file_read_tool = FileReadTool()
|
8 |
-
return {
|
9 |
-
"Data_Reader_Agent": Agent(
|
10 |
-
role='Data_Reader_Agent',
|
11 |
-
goal="Read the uploaded dataset and provide it to other agents.",
|
12 |
-
backstory="Responsible for reading the uploaded dataset.",
|
13 |
-
verbose=True,
|
14 |
-
allow_delegation=False,
|
15 |
-
llm=llm,
|
16 |
-
tools=[file_read_tool]
|
17 |
-
),
|
18 |
-
"Problem_Definition_Agent": Agent(
|
19 |
-
role='Problem_Definition_Agent',
|
20 |
-
goal="Clarify the machine learning problem the user wants to solve.",
|
21 |
-
backstory="Expert in defining machine learning problems.",
|
22 |
-
verbose=True,
|
23 |
-
allow_delegation=False,
|
24 |
-
llm=llm,
|
25 |
-
),
|
26 |
-
"EDA_Agent": Agent(
|
27 |
-
role='EDA_Agent',
|
28 |
-
goal="Perform all possible Exploratory Data Analysis (EDA) on the data provided by the user.",
|
29 |
-
backstory="Specializes in conducting comprehensive EDA to understand the data characteristics, distributions, and relationships.",
|
30 |
-
verbose=True,
|
31 |
-
allow_delegation=False,
|
32 |
-
llm=llm,
|
33 |
-
),
|
34 |
-
"Feature_Engineering_Agent": Agent(
|
35 |
-
role='Feature_Engineering_Agent',
|
36 |
-
goal="Perform feature engineering on the data based on the EDA results provided by the EDA agent.",
|
37 |
-
backstory="Expert in deriving new features, transforming existing features, and preprocessing data to prepare it for modeling.",
|
38 |
-
verbose=True,
|
39 |
-
allow_delegation=False,
|
40 |
-
llm=llm,
|
41 |
-
),
|
42 |
-
"Model_Recommendation_Agent": Agent(
|
43 |
-
role='Model_Recommendation_Agent',
|
44 |
-
goal="Suggest the most suitable machine learning models.",
|
45 |
-
backstory="Expert in recommending machine learning algorithms.",
|
46 |
-
verbose=True,
|
47 |
-
allow_delegation=False,
|
48 |
-
llm=llm,
|
49 |
-
),
|
50 |
-
"Starter_Code_Generator_Agent": Agent(
|
51 |
-
role='Starter_Code_Generator_Agent',
|
52 |
-
goal=f"Generate starter Python code for the project. Always give dataset name as '
|
53 |
-
backstory="Code wizard for generating starter code templates.",
|
54 |
-
verbose=True,
|
55 |
-
allow_delegation=False,
|
56 |
-
llm=llm,
|
57 |
-
),
|
58 |
-
"Code_Modification_Agent": Agent(
|
59 |
-
role='Code_Modification_Agent',
|
60 |
-
goal="Modify the generated Python code based on user suggestions.",
|
61 |
-
backstory="Expert in adapting code according to user feedback.",
|
62 |
-
verbose=True,
|
63 |
-
allow_delegation=False,
|
64 |
-
llm=llm,
|
65 |
-
),
|
66 |
-
# "Code_Runner_Agent": Agent(
|
67 |
-
# role='Code_Runner_Agent',
|
68 |
-
# goal="Run the generated Python code and catch any errors.",
|
69 |
-
# backstory="Debugging expert.",
|
70 |
-
# verbose=True,
|
71 |
-
# allow_delegation=True,
|
72 |
-
# llm=llm,
|
73 |
-
# ),
|
74 |
-
"Code_Debugger_Agent": Agent(
|
75 |
-
role='Code_Debugger_Agent',
|
76 |
-
goal="Debug the generated Python code.",
|
77 |
-
backstory="Seasoned code debugger.",
|
78 |
-
verbose=True,
|
79 |
-
allow_delegation=False,
|
80 |
-
llm=llm,
|
81 |
-
),
|
82 |
-
"Compiler_Agent":Agent(
|
83 |
-
role = "Code_compiler",
|
84 |
-
goal = "Extract only the python code.",
|
85 |
-
backstory = "You are the compiler which extract only the python code.",
|
86 |
-
verbose = True,
|
87 |
-
allow_delegation = False,
|
88 |
-
llm = llm
|
89 |
-
)
|
90 |
-
}
|
|
|
1 |
+
from crewai import Agent
|
2 |
+
from crewai_tools import FileReadTool
|
3 |
+
|
4 |
+
|
5 |
+
# Function to initialize agents
|
6 |
+
def initialize_agents(llm,file_name,Temp_dir):
|
7 |
+
file_read_tool = FileReadTool()
|
8 |
+
return {
|
9 |
+
"Data_Reader_Agent": Agent(
|
10 |
+
role='Data_Reader_Agent',
|
11 |
+
goal="Read the uploaded dataset and provide it to other agents.",
|
12 |
+
backstory="Responsible for reading the uploaded dataset.",
|
13 |
+
verbose=True,
|
14 |
+
allow_delegation=False,
|
15 |
+
llm=llm,
|
16 |
+
tools=[file_read_tool]
|
17 |
+
),
|
18 |
+
"Problem_Definition_Agent": Agent(
|
19 |
+
role='Problem_Definition_Agent',
|
20 |
+
goal="Clarify the machine learning problem the user wants to solve.",
|
21 |
+
backstory="Expert in defining machine learning problems.",
|
22 |
+
verbose=True,
|
23 |
+
allow_delegation=False,
|
24 |
+
llm=llm,
|
25 |
+
),
|
26 |
+
"EDA_Agent": Agent(
|
27 |
+
role='EDA_Agent',
|
28 |
+
goal="Perform all possible Exploratory Data Analysis (EDA) on the data provided by the user.",
|
29 |
+
backstory="Specializes in conducting comprehensive EDA to understand the data characteristics, distributions, and relationships.",
|
30 |
+
verbose=True,
|
31 |
+
allow_delegation=False,
|
32 |
+
llm=llm,
|
33 |
+
),
|
34 |
+
"Feature_Engineering_Agent": Agent(
|
35 |
+
role='Feature_Engineering_Agent',
|
36 |
+
goal="Perform feature engineering on the data based on the EDA results provided by the EDA agent.",
|
37 |
+
backstory="Expert in deriving new features, transforming existing features, and preprocessing data to prepare it for modeling.",
|
38 |
+
verbose=True,
|
39 |
+
allow_delegation=False,
|
40 |
+
llm=llm,
|
41 |
+
),
|
42 |
+
"Model_Recommendation_Agent": Agent(
|
43 |
+
role='Model_Recommendation_Agent',
|
44 |
+
goal="Suggest the most suitable machine learning models.",
|
45 |
+
backstory="Expert in recommending machine learning algorithms.",
|
46 |
+
verbose=True,
|
47 |
+
allow_delegation=False,
|
48 |
+
llm=llm,
|
49 |
+
),
|
50 |
+
"Starter_Code_Generator_Agent": Agent(
|
51 |
+
role='Starter_Code_Generator_Agent',
|
52 |
+
goal=f"Generate starter Python code for the project. Always give dataset name as '{Temp_dir}/{file_name}",
|
53 |
+
backstory="Code wizard for generating starter code templates.",
|
54 |
+
verbose=True,
|
55 |
+
allow_delegation=False,
|
56 |
+
llm=llm,
|
57 |
+
),
|
58 |
+
"Code_Modification_Agent": Agent(
|
59 |
+
role='Code_Modification_Agent',
|
60 |
+
goal="Modify the generated Python code based on user suggestions.",
|
61 |
+
backstory="Expert in adapting code according to user feedback.",
|
62 |
+
verbose=True,
|
63 |
+
allow_delegation=False,
|
64 |
+
llm=llm,
|
65 |
+
),
|
66 |
+
# "Code_Runner_Agent": Agent(
|
67 |
+
# role='Code_Runner_Agent',
|
68 |
+
# goal="Run the generated Python code and catch any errors.",
|
69 |
+
# backstory="Debugging expert.",
|
70 |
+
# verbose=True,
|
71 |
+
# allow_delegation=True,
|
72 |
+
# llm=llm,
|
73 |
+
# ),
|
74 |
+
"Code_Debugger_Agent": Agent(
|
75 |
+
role='Code_Debugger_Agent',
|
76 |
+
goal="Debug the generated Python code.",
|
77 |
+
backstory="Seasoned code debugger.",
|
78 |
+
verbose=True,
|
79 |
+
allow_delegation=False,
|
80 |
+
llm=llm,
|
81 |
+
),
|
82 |
+
"Compiler_Agent":Agent(
|
83 |
+
role = "Code_compiler",
|
84 |
+
goal = "Extract only the python code.",
|
85 |
+
backstory = "You are the compiler which extract only the python code.",
|
86 |
+
verbose = True,
|
87 |
+
allow_delegation = False,
|
88 |
+
llm = llm
|
89 |
+
)
|
90 |
+
}
|