tooluniverse 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of tooluniverse might be problematic. Click here for more details.

@@ -33,14 +33,19 @@ tool_type_mappings = {
33
33
 
34
34
 
35
35
  class ToolUniverse:
36
- def __init__(self, tool_files=default_tool_files):
36
+ def __init__(self, tool_files=default_tool_files, keep_default_tools=True):
37
37
  # Initialize any necessary attributes here
38
38
  self.all_tools = []
39
39
  self.all_tool_dict = {}
40
40
  self.tool_category_dicts = {}
41
41
  if tool_files is None:
42
42
  tool_files = default_tool_files
43
+ elif keep_default_tools:
44
+ default_tool_files.update(tool_files)
45
+ tool_files = default_tool_files
43
46
  self.tool_files = tool_files
47
+ print("Tool files:")
48
+ print(tool_files)
44
49
  self.callable_functions = {}
45
50
 
46
51
  def load_tools(self, tool_type=None):
@@ -125,8 +130,10 @@ class ToolUniverse:
125
130
  print(f"Tool name {each_name} not found in the loaded tools.")
126
131
  return picked_tool_list
127
132
 
128
- def get_one_tool_by_one_name(self, tool_name):
133
+ def get_one_tool_by_one_name(self, tool_name, return_prompt=False):
129
134
  if tool_name in self.all_tool_dict:
135
+ if return_prompt:
136
+ return self.prepare_one_tool_prompt(self.all_tool_dict[tool_name])
130
137
  return self.all_tool_dict[tool_name]
131
138
  else:
132
139
  print(f"Tool name {tool_name} not found in the loaded tools.")
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Artificial Intelligence for Medicine and Science @ Harvard
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,132 @@
1
+ Metadata-Version: 2.2
2
+ Name: tooluniverse
3
+ Version: 0.1.2
4
+ Summary: A collection of biomedical tools designed for use by Agentic AI.
5
+ Home-page: https://github.com/mims-harvard/TxAgent
6
+ Author: Shanghua Gao
7
+ Author-email: shanghuagao@gmail.com
8
+ Requires-Python: >=3.6
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: requests
12
+ Requires-Dist: numpy
13
+ Requires-Dist: graphql-core
14
+
15
+ # ToolUniverse
16
+
17
+ [![ProjectPage](https://img.shields.io/badge/Page-TxAgent-red)](https://zitniklab.hms.harvard.edu/TxAgent)
18
+ [![PaperLink](https://img.shields.io/badge/PDF-TxAgent-red)]()
19
+ [![TxAgent-PIP](https://img.shields.io/badge/Pip-TxAgent-blue)](https://pypi.org/project/txagent/)
20
+ [![ToolUniverse-PIP](https://img.shields.io/badge/Pip-ToolUniverse-blue)](https://pypi.org/project/tooluniverse/)
21
+ [![TxAgent](https://img.shields.io/badge/Code-TxAgent-purple)](https://github.com/mims-harvard/TxAgent)
22
+ [![ToolUniverse](https://img.shields.io/badge/Code-ToolUniverse-purple)](https://github.com/mims-harvard/ToolUniverse)
23
+ [![HuggingFace](https://img.shields.io/badge/HuggingFace-TxAgentT1-yellow)](https://huggingface.co/collections/mims-harvard/txagent-67c8e54a9d03a429bb0c622c)
24
+
25
+ <body>
26
+ <section class="hero">
27
+ <div class="hero-body">
28
+ <div class="container is-max-desktop">
29
+ <div class="columns is-centered">
30
+ <div class="column has-text-centered">
31
+ <h1 class="title is-1 publication-title">
32
+ </h1>
33
+ <div class="is-size-5 publication-authors">
34
+ <!-- Paper authors -->
35
+ <span class="author-block">
36
+ <a href="https://shgao.site" target="_blank">Shanghua Gao</a
37
+ >,</span
38
+ >
39
+ <span class="author-block">
40
+ <a
41
+ href="https://www.linkedin.com/in/richard-zhu-4236901a7/"
42
+ target="_blank"
43
+ >Richard Zhu</a
44
+ >,</span
45
+ >
46
+ <span class="author-block">
47
+ <a href="https://zlkong.github.io/homepage/" target="_blank"
48
+ >Zhenglun Kong</a
49
+ >,</span
50
+ >
51
+ <span class="author-block">
52
+ <a href="https://www.ayushnoori.com/" target="_blank"
53
+ >Ayush Noori</a
54
+ >,</span
55
+ >
56
+ <span class="author-block">
57
+ <a
58
+ href="https://scholar.google.com/citations?hl=zh-CN&user=Awdn73MAAAAJ"
59
+ target="_blank"
60
+ >Xiaorui Su</a
61
+ >,</span
62
+ >
63
+ <span class="author-block">
64
+ <a
65
+ href="https://www.linkedin.com/in/curtisginder/"
66
+ target="_blank"
67
+ >Curtis Ginder</a
68
+ >,</span
69
+ >
70
+ <span class="author-block">
71
+ <a href="https://sites.google.com/view/theo-t" target="_blank"
72
+ >Theodoros Tsiligkaridis</a
73
+ >,</span
74
+ >
75
+ <span class="author-block">
76
+ <a href="https://zitniklab.hms.harvard.edu/" target="_blank"
77
+ >Marinka Zitnik</a
78
+ >
79
+ </div>
80
+
81
+
82
+ ToolUniverse is a collection of biomedical tools designed for use by Agentic AI. It is a critical component of TxAgent, providing the agent with the ability to access and leverage a vast array of biomedical knowledge to solve complex therapeutic reasoning tasks. ToolUniverse includes 211 biomedical tools that address various aspects of drugs and diseases. These tools are linked to trusted sources, including all US FDA-approved drugs since 1939 and validated clinical insights from Open Targets and Monarch Initiative.
83
+
84
+ ![TxAgent](img/TxAgent_ToolUniverse.jpg)
85
+
86
+
87
+ # Install
88
+
89
+ ### Install from source
90
+
91
+ ```
92
+ python -m pip install . --no-cache-dir
93
+ ```
94
+
95
+ ### Install from Pypi
96
+ Pip page (https://pypi.org/project/tooluniverse)
97
+
98
+ ```
99
+ pip install tooluniverse
100
+ ```
101
+
102
+ # Usage
103
+
104
+ **Get all tools**
105
+
106
+ ```
107
+ from tooluniverse import ToolUniverse
108
+ tooluni = ToolUniverse()
109
+ tooluni.load_tools()
110
+ tool_name_list, tool_desc_list = tooluni.refresh_tool_name_desc()
111
+ print(tool_name_list)
112
+ print(tool_desc_list)
113
+ ```
114
+
115
+ **Function call to a tool**
116
+
117
+ ```
118
+ from tooluniverse import ToolUniverse
119
+ tooluni = ToolUniverse()
120
+ tooluni.load_tools()
121
+ query = {"name": "get_indications_by_drug_name", "arguments": {"drug_name": "KISUNLA"}}
122
+ tooluni.run(query)
123
+ ```
124
+ ## Citation
125
+
126
+ ```
127
+
128
+ ```
129
+
130
+ ## Contact
131
+ If you have any questions or suggestions, please email [Shanghua Gao](mailto:shanghuagao@gmail.com) and [Marinka Zitnik](mailto:marinka@hms.harvard.edu).
132
+
@@ -1,6 +1,6 @@
1
1
  tooluniverse/__init__.py,sha256=j44hf13WM50HQJRi7aloeTG6y6872wJtfX8ydsaiJFI,652
2
2
  tooluniverse/base_tool.py,sha256=WMGgr02lhEsVzHgt7NIeynXQ2wZtu97yZI-lQWOSoSs,1145
3
- tooluniverse/execute_function.py,sha256=HC3i4B_ATakUgGnDBiT7w2Zdd2Cpa3UCcx8wzoevH1k,9790
3
+ tooluniverse/execute_function.py,sha256=CmA8AIfyolkcooASD2_3pXgF1BqESU5_VUqdHSYiM_M,10139
4
4
  tooluniverse/graphql_tool.py,sha256=FpyP70ZiQkd031crECAhZ7CbXBor8x6S-n48VICnxVs,5086
5
5
  tooluniverse/openfda_tool.py,sha256=SPs4skPqwaC2RaZvqD1LA31VeQmMl4bOh7CkTpJKM5U,21017
6
6
  tooluniverse/restful_tool.py,sha256=5HoTyCSd507D4Qjcqjd16o8Y4BFZ02Zm4cGuczIXWdw,4078
@@ -11,7 +11,8 @@ tooluniverse/data/fda_drugs_with_brand_generic_names_for_tool.py,sha256=Clb7kQpP
11
11
  tooluniverse/data/monarch_tools.json,sha256=I5KvamNZRvkKBaKbM6Ypo333m-RejQhqScX8h-uket4,3567
12
12
  tooluniverse/data/opentarget_tools.json,sha256=nNvl-vYqS8nLfyIvHO40Fsnx6HJxwInUuS0mrrh6xmY,66201
13
13
  tooluniverse/data/special_tools.json,sha256=tOI0TFpdjZBEE5Af1Vc4CeXQ0gAkz39xho9hDVBYR70,1518
14
- tooluniverse-0.1.0.dist-info/METADATA,sha256=YuX65va7z43zUCVyD6PwZFp4A0R59Y7t3jRqgqQJcVo,1088
15
- tooluniverse-0.1.0.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
16
- tooluniverse-0.1.0.dist-info/top_level.txt,sha256=zZ8YeCJ5FAkEwdd_mxsFtSCQMBDgBdxrrmHo3RNBiWs,13
17
- tooluniverse-0.1.0.dist-info/RECORD,,
14
+ tooluniverse-0.1.2.dist-info/LICENSE,sha256=Unq9Y3buGL9J0vFop03FYZiVweytt1xdgLIh2n9ck2c,1115
15
+ tooluniverse-0.1.2.dist-info/METADATA,sha256=jIX6oJVszWsBMomzMZjhbPnH2ymvaq8tD6z6BbyOE78,4742
16
+ tooluniverse-0.1.2.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
17
+ tooluniverse-0.1.2.dist-info/top_level.txt,sha256=zZ8YeCJ5FAkEwdd_mxsFtSCQMBDgBdxrrmHo3RNBiWs,13
18
+ tooluniverse-0.1.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,54 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: tooluniverse
3
- Version: 0.1.0
4
- Summary: A collection of biomedical tools designed for use by Agentic AI.
5
- Home-page: https://github.com/mims-harvard/TxAgent
6
- Author: Shanghua Gao
7
- Author-email: shanghuagao@gmail.com
8
- Requires-Python: >=3.6
9
- Description-Content-Type: text/markdown
10
- Requires-Dist: requests
11
- Requires-Dist: numpy
12
- Requires-Dist: graphql
13
-
14
- # ToolUniverse
15
-
16
- ToolUniverse is a collection of biomedical tools designed for use by Agentic AI.
17
-
18
- # Install
19
-
20
- ### Local install
21
-
22
- ```
23
- python -m pip install . --no-cache-dir
24
- ```
25
-
26
- ### Install from PIP
27
-
28
- ```
29
- pip install tooluniverse
30
- ```
31
-
32
- ### Usage
33
-
34
- Get all tools
35
-
36
- ```
37
- from tooluniverse import ToolUniverse
38
- tooluni = ToolUniverse()
39
- tooluni.load_tools()
40
- tool_name_list, tool_desc_list = tooluni.refresh_tool_name_desc()
41
- print(tool_name_list)
42
- print(tool_desc_list)
43
- ```
44
-
45
- Function call to a tool
46
-
47
- ```
48
- from tooluniverse import ToolUniverse
49
- tooluni = ToolUniverse()
50
- tooluni.load_tools()
51
- tooluni.refresh_tool_name_desc()
52
- query = {"name": "get_indications_by_drug_name", "arguments": {"drug_name": "KISUNLA"}}
53
- tooluni.run(query)
54
- ```