tooluniverse 0.1.0__tar.gz

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.

@@ -0,0 +1,54 @@
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
+ ```
@@ -0,0 +1,41 @@
1
+ # ToolUniverse
2
+
3
+ ToolUniverse is a collection of biomedical tools designed for use by Agentic AI.
4
+
5
+ # Install
6
+
7
+ ### Local install
8
+
9
+ ```
10
+ python -m pip install . --no-cache-dir
11
+ ```
12
+
13
+ ### Install from PIP
14
+
15
+ ```
16
+ pip install tooluniverse
17
+ ```
18
+
19
+ ### Usage
20
+
21
+ Get all tools
22
+
23
+ ```
24
+ from tooluniverse import ToolUniverse
25
+ tooluni = ToolUniverse()
26
+ tooluni.load_tools()
27
+ tool_name_list, tool_desc_list = tooluni.refresh_tool_name_desc()
28
+ print(tool_name_list)
29
+ print(tool_desc_list)
30
+ ```
31
+
32
+ Function call to a tool
33
+
34
+ ```
35
+ from tooluniverse import ToolUniverse
36
+ tooluni = ToolUniverse()
37
+ tooluni.load_tools()
38
+ tooluni.refresh_tool_name_desc()
39
+ query = {"name": "get_indications_by_drug_name", "arguments": {"drug_name": "KISUNLA"}}
40
+ tooluni.run(query)
41
+ ```
@@ -0,0 +1,3 @@
1
+ [build-system]
2
+ requires = ["setuptools", "wheel"]
3
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,31 @@
1
+ [metadata]
2
+ name = tooluniverse
3
+ version = 0.1.0
4
+ description = A collection of biomedical tools designed for use by Agentic AI.
5
+ author = Shanghua Gao
6
+ author_email = shanghuagao@gmail.com
7
+ url = https://github.com/mims-harvard/TxAgent
8
+ long_description = file: README.md
9
+ long_description_content_type = text/markdown
10
+
11
+ [options]
12
+ packages = find:
13
+ package_dir =
14
+ = src
15
+ python_requires = >=3.6
16
+ install_requires =
17
+ requests
18
+ numpy
19
+ graphql
20
+
21
+ [options.packages.find]
22
+ where = src
23
+
24
+ [options.package_data]
25
+ tooluniverse =
26
+ data/*
27
+
28
+ [egg_info]
29
+ tag_build =
30
+ tag_date = 0
31
+
@@ -0,0 +1,17 @@
1
+ from .execute_function import ToolUniverse
2
+ from .restful_tool import MonarchTool, MonarchDiseasesForMultiplePhenoTool
3
+ from .graphql_tool import OpentargetTool, OpentargetGeneticsTool, OpentargetToolDrugNameMatch
4
+ from .openfda_tool import FDADrugLabelTool, FDADrugLabelSearchTool, FDADrugLabelSearchIDTool, FDADrugLabelGetDrugGenericNameTool
5
+
6
+ __all__ = [
7
+ "ToolUniverse",
8
+ "MonarchTool",
9
+ "MonarchDiseasesForMultiplePhenoTool",
10
+ "OpentargetTool",
11
+ "OpentargetGeneticsTool",
12
+ "OpentargetToolDrugNameMatch",
13
+ "FDADrugLabelTool",
14
+ "FDADrugLabelSearchTool",
15
+ "FDADrugLabelSearchIDTool",
16
+ "FDADrugLabelGetDrugGenericNameTool"
17
+ ]
@@ -0,0 +1,32 @@
1
+ from .utils import extract_function_call_json, evaluate_function_call
2
+
3
+ class BaseTool:
4
+ def __init__(self, tool_config):
5
+ self.tool_config = tool_config
6
+
7
+ def run(self):
8
+ pass
9
+
10
+ def check_function_call(self, function_call_json):
11
+ if isinstance(function_call_json, str):
12
+ function_call_json = extract_function_call_json(function_call_json)
13
+ if function_call_json is not None:
14
+ return evaluate_function_call(self.tool_config, function_call_json)
15
+ else:
16
+ return False, "Invalid JSON string of function call"
17
+
18
+ def get_required_parameters(self):
19
+ """
20
+ Retrieve required parameters from the endpoint definition.
21
+ Returns:
22
+ list: List of required parameters for the given endpoint.
23
+ """
24
+ required_params = []
25
+ parameters = self.tool_config.get('parameter', {}).get('properties', {})
26
+
27
+ # Check each parameter to see if it is required
28
+ for param, details in parameters.items():
29
+ if details.get('required', False):
30
+ required_params.append(param.lower())
31
+
32
+ return required_params
File without changes