tooluniverse 0.1.0__py3-none-any.whl → 0.1.1__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,124 @@
1
+ Metadata-Version: 2.2
2
+ Name: tooluniverse
3
+ Version: 0.1.1
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
+ 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)]()
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
+ ><sup>,</span
79
+ >
80
+ </div>
81
+
82
+
83
+ 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.
84
+
85
+ ![TxAgent](img/TxAgent_ToolUniverse.jpg)
86
+
87
+
88
+ # Install
89
+
90
+ ### Install from source
91
+
92
+ ```
93
+ python -m pip install . --no-cache-dir
94
+ ```
95
+
96
+ ### Install from Pypi
97
+ Pip page (https://pypi.org/project/tooluniverse)
98
+
99
+ ```
100
+ pip install tooluniverse
101
+ ```
102
+
103
+ # Usage
104
+
105
+ **Get all tools**
106
+
107
+ ```
108
+ from tooluniverse import ToolUniverse
109
+ tooluni = ToolUniverse()
110
+ tooluni.load_tools()
111
+ tool_name_list, tool_desc_list = tooluni.refresh_tool_name_desc()
112
+ print(tool_name_list)
113
+ print(tool_desc_list)
114
+ ```
115
+
116
+ **Function call to a tool**
117
+
118
+ ```
119
+ from tooluniverse import ToolUniverse
120
+ tooluni = ToolUniverse()
121
+ tooluni.load_tools()
122
+ query = {"name": "get_indications_by_drug_name", "arguments": {"drug_name": "KISUNLA"}}
123
+ tooluni.run(query)
124
+ ```
@@ -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,7 @@ 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.1.dist-info/METADATA,sha256=kMKoHTBKtQQ3RDEEfYFt3JNSxhz5fHacXvcHlRubrbo,4551
15
+ tooluniverse-0.1.1.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
16
+ tooluniverse-0.1.1.dist-info/top_level.txt,sha256=zZ8YeCJ5FAkEwdd_mxsFtSCQMBDgBdxrrmHo3RNBiWs,13
17
+ tooluniverse-0.1.1.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
- ```