Spaces:
Sleeping
Sleeping
Add community tools
Browse files- community_tools.py +17 -0
- mini_agents.py +2 -1
community_tools.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from langchain_community.tools import GooglePlacesTool
|
2 |
+
from langchain.agents import load_tools
|
3 |
+
from smolagents.tools import Tool
|
4 |
+
|
5 |
+
import os
|
6 |
+
os.environ["GPLACES_API_KEY"] = "AIzaSyBpYITz-7liGXiXF-bpkjMFsmDoyRp0YXc"
|
7 |
+
|
8 |
+
google_map_tool = Tool.from_langchain(GooglePlacesTool())
|
9 |
+
|
10 |
+
from langchain_community.tools import WikipediaQueryRun
|
11 |
+
from langchain_community.utilities import WikipediaAPIWrapper
|
12 |
+
|
13 |
+
wikipedia_tool = Tool.from_langchain(WikipediaQueryRun(api_wrapper=WikipediaAPIWrapper()))
|
14 |
+
|
15 |
+
arxiv_tools = [Tool.from_langchain(tool) for tool in load_tools(["arxiv"])]
|
16 |
+
|
17 |
+
community_tools = [google_map_tool, wikipedia_tool, *arxiv_tools]
|
mini_agents.py
CHANGED
@@ -3,6 +3,7 @@ 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 |
import os
|
7 |
|
8 |
MODEL_CHOICES = {
|
@@ -93,7 +94,7 @@ operation_manager = CodeAgent(
|
|
93 |
master_agent = CodeAgent(
|
94 |
model=MODEL_CHOICES["master"][0],
|
95 |
managed_agents=[multimodal_manager, operation_manager],
|
96 |
-
tools=[sort_list],
|
97 |
max_steps=16,
|
98 |
planning_interval=4,
|
99 |
name="master_agent",
|
|
|
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 = {
|
|
|
94 |
master_agent = CodeAgent(
|
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",
|