Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Commit 6257709

Browse files
authored
allow adding self defined tool (#76)
1 parent 4da01e6 commit 6257709

15 files changed

Lines changed: 119 additions & 32 deletions

examples/atomic/DBRetrievalAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main():
2828
"model_name": "gpt-4o-mini",
2929
"tool_choice": "auto"
3030
},
31-
"tools": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
31+
"tool_names": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
3232
"agent_description": "Use a database retrieval agent to fetch information based on a given query.",
3333
"parameter_description": "The query to be processed by the database retrieval agent."
3434
}

examples/atomic/ExecAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main():
2828
"model_name": "gpt-4o-mini",
2929
"tool_choice": "auto"
3030
},
31-
"tools": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
31+
"tool_names": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
3232
"agent_description": "Execute some script in a subprocess, either run a bash script, or run a python script ",
3333
"parameter_description": "The task description describing what to execute in the subprocess."
3434
}

examples/atomic/FileRetrievalAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main():
2828
"model_name": "gpt-4o-mini",
2929
"tool_choice": "auto"
3030
},
31-
"tools": ["retrieve_file"],
31+
"tool_names": ["retrieve_file"],
3232
"agent_description": "Retrieve information from local documents to answer questions or perform tasks.",
3333
"parameter_description": "The task description specifying the local file and the question to be answered. specify this in natural language"
3434
}

examples/atomic/IOAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def main():
2929
"model_name": "gpt-4o-mini",
3030
"tool_choice": "auto"
3131
},
32-
"tools": ["read_file", "write_to_file", "generate_and_download_image"],
32+
"tool_names": ["read_file", "write_to_file", "generate_and_download_image"],
3333
"agent_description": "Read or write content from/to a file, or generate and save an image using text input",
3434
"parameter_description": "The task description detailing what to read, write, or generate. This can include file operations or image generation requests."
3535
}

examples/atomic/WebAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def main():
2727
"model_name": "gpt-4o-mini",
2828
"tool_choice": "auto"
2929
},
30-
"tools": ["call_webagent"],
30+
"tool_names": ["call_webagent"],
3131
"agent_description": "Use a web agent to perform tasks and fetch information from web pages based on a given instruction.",
3232
"parameter_description": "A natural language instruction describing the task to be performed by the web agent, including the starting URL and the goal."
3333
}

examples/atomic/WebRetrievalAgent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def main():
2828
"model_name": "gpt-4o-mini",
2929
"tool_choice": "auto"
3030
},
31-
"tools": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
31+
"tool_names": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
3232
"agent_description": "Perform a search using API and return the searched results.",
3333
"parameter_description": "The task description describing what to read or write."
3434
}

examples/composite/MasterAgent.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main():
3131
"model_name": "gpt-4o-mini",
3232
"tool_choice": "auto"
3333
},
34-
"tools": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
34+
"tool_names": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
3535
"agent_description": "Read or write content from/to a file, or generate and save an image using text input",
3636
"parameter_description": "The task description detailing what to read, write, or generate. This can include file operations or image generation requests."
3737
}
@@ -49,7 +49,7 @@ def main():
4949
"model_name": "gpt-4o-mini",
5050
"tool_choice": "auto"
5151
},
52-
"tools": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
52+
"tool_names": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
5353
"agent_description": "Use a database retrieval agent to fetch information based on a given query.",
5454
"parameter_description": "The query to be processed by the database retrieval agent."
5555
}
@@ -67,7 +67,7 @@ def main():
6767
"model_name": "gpt-4o-mini",
6868
"tool_choice": "auto"
6969
},
70-
"tools": ["retrieve_file"], # Changed from "write_file" to "write_to_file"
70+
"tool_names": ["retrieve_file"], # Changed from "write_file" to "write_to_file"
7171
"agent_description": "Retrieve information from local documents to answer questions or perform tasks.",
7272
"parameter_description": "The task description specifying the local file and the question to be answered. specify this in natural language"
7373
}
@@ -85,7 +85,7 @@ def main():
8585
"model_name": "gpt-4o-mini",
8686
"tool_choice": "auto"
8787
},
88-
"tools": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
88+
"tool_names": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
8989
"agent_description": "Perform a search using API and return the searched results.",
9090
"parameter_description": "The task description describing what to read or write."
9191
}
@@ -103,7 +103,7 @@ def main():
103103
"model_name": "gpt-4o-mini",
104104
"tool_choice": "auto"
105105
},
106-
"tools": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
106+
"tool_names": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
107107
"agent_description": "Execute some script in a subprocess, either run a bash script, or run a python script ",
108108
"parameter_description": "The task description describing what to execute in the subprocess."
109109
}
@@ -121,7 +121,7 @@ def main():
121121
"model_name": "gpt-4o-mini",
122122
"tool_choice": "auto"
123123
},
124-
"tools": [],
124+
"tool_names": [],
125125
"sub_agents": [
126126
web_retrieval_agent_config,
127127
file_retrieval_agent_config,
@@ -144,7 +144,7 @@ def main():
144144
"model_name": "gpt-4o-mini",
145145
"tool_choice": "auto"
146146
},
147-
"tools": ["scan_folder"],
147+
"tool_names": ["scan_folder"],
148148
"sub_agents": [
149149
retrieval_agent_config,
150150
exec_agent_config,

examples/composite/RetrievalAgent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main():
3131
"model_name": "gpt-4o-mini",
3232
"tool_choice": "auto"
3333
},
34-
"tools": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
34+
"tool_names": ["retrieve_db"], # Changed from "write_file" to "write_to_file"
3535
"agent_description": "Use a database retrieval agent to fetch information based on a given query.",
3636
"parameter_description": "The query to be processed by the database retrieval agent."
3737
}
@@ -49,7 +49,7 @@ def main():
4949
"model_name": "gpt-4o-mini",
5050
"tool_choice": "auto"
5151
},
52-
"tools": ["retrieve_file"], # Changed from "write_file" to "write_to_file"
52+
"tool_names": ["retrieve_file"], # Changed from "write_file" to "write_to_file"
5353
"agent_description": "Retrieve information from local documents to answer questions or perform tasks.",
5454
"parameter_description": "The task description specifying the local file and the question to be answered. specify this in natural language"
5555
}
@@ -67,7 +67,7 @@ def main():
6767
"model_name": "gpt-4o-mini",
6868
"tool_choice": "auto"
6969
},
70-
"tools": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
70+
"tool_names": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
7171
"agent_description": "Perform a search using API and return the searched results.",
7272
"parameter_description": "The task description describing what to read or write."
7373
}
@@ -85,7 +85,7 @@ def main():
8585
"model_name": "gpt-4o-mini",
8686
"tool_choice": "auto"
8787
},
88-
"tools": [],
88+
"tool_names": [],
8989
"sub_agents": [
9090
web_retrieval_agent_config,
9191
file_retrieval_agent_config,

examples/composite/coding/CodingAgent.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def main():
3232
"model_name": "gpt-4o-mini",
3333
"tool_choice": "auto"
3434
},
35-
"tools": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
35+
"tool_names": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
3636
"agent_description": "Read or write content from/to a file, or generate and save an image using text input",
3737
"parameter_description": "The task description detailing what to read, write, or generate. This can include file operations or image generation requests."
3838
}
@@ -51,7 +51,7 @@ def main():
5151
"model_name": "gpt-4o-mini",
5252
"tool_choice": "auto"
5353
},
54-
"tools": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
54+
"tool_names": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
5555
"agent_description": "Execute some script in a subprocess, either run a bash script, or run a python script ",
5656
"parameter_description": "The task description describing what to execute in the subprocess."
5757
}
@@ -70,7 +70,7 @@ def main():
7070
"model_name": "gpt-4o-mini",
7171
"tool_choice": "auto"
7272
},
73-
"tools": ["scan_folder"],
73+
"tool_names": ["scan_folder"],
7474
"sub_agents": [
7575
exec_agent_config,
7676
io_agent_config,

examples/composite/research/ResearchAgent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def main():
3131
"model_name": "gpt-4o-mini",
3232
"tool_choice": "auto"
3333
},
34-
"tools": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
34+
"tool_names": ["read_file", "write_to_file", "generate_and_download_image"], # Changed from "write_file" to "write_to_file"
3535
"agent_description": "Read or write content from/to a file, or generate and save an image using text input",
3636
"parameter_description": "The task description detailing what to read, write, or generate. This can include file operations or image generation requests."
3737
}
@@ -49,7 +49,7 @@ def main():
4949
"model_name": "gpt-4o-mini",
5050
"tool_choice": "auto"
5151
},
52-
"tools": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
52+
"tool_names": ["bing_search", "scrape"], # Changed from "write_file" to "write_to_file"
5353
"agent_description": "Perform a search using API and return the searched results.",
5454
"parameter_description": "The task description describing what to read or write."
5555
}
@@ -67,7 +67,7 @@ def main():
6767
"model_name": "gpt-4o-mini",
6868
"tool_choice": "auto"
6969
},
70-
"tools": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
70+
"tool_names": ["execute_shell_command", "run_python_script"], # Changed from "write_file" to "write_to_file"
7171
"agent_description": "Execute some script in a subprocess, either run a bash script, or run a python script ",
7272
"parameter_description": "The task description describing what to execute in the subprocess."
7373
}
@@ -86,7 +86,7 @@ def main():
8686
"model_name": "gpt-4o-mini",
8787
"tool_choice": "auto"
8888
},
89-
"tools": ["scan_folder"],
89+
"tool_names": ["scan_folder"],
9090
"sub_agents": [
9191
web_retrieval_agent_config,
9292
exec_agent_config,

0 commit comments

Comments
 (0)