huytofu92 commited on
Commit
01186d8
·
1 Parent(s): 262b410

Fix import and agent types

Browse files
Files changed (2) hide show
  1. community_tools.py +2 -2
  2. mini_agents.py +8 -4
community_tools.py CHANGED
@@ -1,5 +1,5 @@
1
- from langchain_community.tools import GooglePlacesTool
2
- from langchain.agents import load_tools
3
  from smolagents.tools import Tool
4
 
5
  import os
 
1
+ from langchain_google_community import GooglePlacesTool
2
+ from langchain_community.agent_toolkits.load_tools import load_tools
3
  from smolagents.tools import Tool
4
 
5
  import os
mini_agents.py CHANGED
@@ -1,10 +1,13 @@
1
- from smolagents import CodeAgent, InferenceClientModel, MultiStepAgent
2
  from tools import sort_list, operate_two_numbers, convert_number
3
  from tools import to_dataframe, to_json, get_dataframe_data, get_dataframe_column, get_dataframe_row, get_dataframe_groupby
4
  from vlm_tools import download_image, image_processing, object_detection, ocr_scan
5
  from audio_tools import audio_to_base64, noise_reduction, audio_segmentation, speaker_diarization
6
  from community_tools import community_tools
7
  import os
 
 
 
8
 
9
  MODEL_CHOICES = {
10
  "audio": ["whisper-large-v3"],
@@ -71,7 +74,7 @@ pandas_agent = CodeAgent(
71
  description="This agent is responsible for converting data to a dataframe, performing pandas operations on such dataframe and converting the dataframe back to a json or a csv file."
72
  )
73
 
74
- multimodal_manager = MultiStepAgent(
75
  model=MODEL_CHOICES["code"][0],
76
  managed_agents=[audio_agent, vlm_agent],
77
  tools=[sort_list],
@@ -81,7 +84,7 @@ multimodal_manager = MultiStepAgent(
81
  description="This agent is responsible for managing the audio and vlm agents."
82
  )
83
 
84
- operation_manager = MultiStepAgent(
85
  model=MODEL_CHOICES["code"][0],
86
  managed_agents=[arithmetic_agent, pandas_agent],
87
  tools=[sort_list],
@@ -91,11 +94,12 @@ operation_manager = MultiStepAgent(
91
  description="This agent is responsible for managing the arithmetic and pandas agents."
92
  )
93
 
94
- master_agent = MultiStepAgent(
95
  model=MODEL_CHOICES["master"][0],
96
  managed_agents=[multimodal_manager, operation_manager],
97
  tools=[sort_list, *community_tools],
98
  max_steps=16,
 
99
  planning_interval=4,
100
  name="master_agent",
101
  description="This agent is responsible for managing the multimodal and operation managers."
 
1
+ from smolagents import CodeAgent, InferenceClientModel
2
  from tools import sort_list, operate_two_numbers, convert_number
3
  from tools import to_dataframe, to_json, get_dataframe_data, get_dataframe_column, get_dataframe_row, get_dataframe_groupby
4
  from vlm_tools import download_image, image_processing, object_detection, ocr_scan
5
  from audio_tools import audio_to_base64, noise_reduction, audio_segmentation, speaker_diarization
6
  from community_tools import community_tools
7
  import os
8
+ import logging
9
+
10
+ logging.basicConfig(level=logging.DEBUG)
11
 
12
  MODEL_CHOICES = {
13
  "audio": ["whisper-large-v3"],
 
74
  description="This agent is responsible for converting data to a dataframe, performing pandas operations on such dataframe and converting the dataframe back to a json or a csv file."
75
  )
76
 
77
+ multimodal_manager = CodeAgent(
78
  model=MODEL_CHOICES["code"][0],
79
  managed_agents=[audio_agent, vlm_agent],
80
  tools=[sort_list],
 
84
  description="This agent is responsible for managing the audio and vlm agents."
85
  )
86
 
87
+ operation_manager = CodeAgent(
88
  model=MODEL_CHOICES["code"][0],
89
  managed_agents=[arithmetic_agent, pandas_agent],
90
  tools=[sort_list],
 
94
  description="This agent is responsible for managing the arithmetic and pandas agents."
95
  )
96
 
97
+ master_agent = CodeAgent(
98
  model=MODEL_CHOICES["master"][0],
99
  managed_agents=[multimodal_manager, operation_manager],
100
  tools=[sort_list, *community_tools],
101
  max_steps=16,
102
+ verbosity_level=logging.DEBUG,
103
  planning_interval=4,
104
  name="master_agent",
105
  description="This agent is responsible for managing the multimodal and operation managers."