tooluniverse 0.1.4__py3-none-any.whl ā 1.0.0__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.
- tooluniverse/__init__.py +340 -4
- tooluniverse/admetai_tool.py +84 -0
- tooluniverse/agentic_tool.py +563 -0
- tooluniverse/alphafold_tool.py +96 -0
- tooluniverse/base_tool.py +129 -6
- tooluniverse/boltz_tool.py +207 -0
- tooluniverse/chem_tool.py +192 -0
- tooluniverse/compose_scripts/__init__.py +1 -0
- tooluniverse/compose_scripts/biomarker_discovery.py +293 -0
- tooluniverse/compose_scripts/comprehensive_drug_discovery.py +186 -0
- tooluniverse/compose_scripts/drug_safety_analyzer.py +89 -0
- tooluniverse/compose_scripts/literature_tool.py +34 -0
- tooluniverse/compose_scripts/output_summarizer.py +279 -0
- tooluniverse/compose_scripts/tool_description_optimizer.py +681 -0
- tooluniverse/compose_scripts/tool_discover.py +705 -0
- tooluniverse/compose_scripts/tool_graph_composer.py +448 -0
- tooluniverse/compose_tool.py +371 -0
- tooluniverse/ctg_tool.py +1002 -0
- tooluniverse/custom_tool.py +81 -0
- tooluniverse/dailymed_tool.py +108 -0
- tooluniverse/data/admetai_tools.json +155 -0
- tooluniverse/data/agentic_tools.json +1156 -0
- tooluniverse/data/alphafold_tools.json +87 -0
- tooluniverse/data/boltz_tools.json +9 -0
- tooluniverse/data/chembl_tools.json +16 -0
- tooluniverse/data/clait_tools.json +108 -0
- tooluniverse/data/clinicaltrials_gov_tools.json +326 -0
- tooluniverse/data/compose_tools.json +202 -0
- tooluniverse/data/dailymed_tools.json +70 -0
- tooluniverse/data/dataset_tools.json +646 -0
- tooluniverse/data/disease_target_score_tools.json +712 -0
- tooluniverse/data/efo_tools.json +17 -0
- tooluniverse/data/embedding_tools.json +319 -0
- tooluniverse/data/enrichr_tools.json +31 -0
- tooluniverse/data/europe_pmc_tools.json +22 -0
- tooluniverse/data/expert_feedback_tools.json +10 -0
- tooluniverse/data/fda_drug_adverse_event_tools.json +491 -0
- tooluniverse/data/fda_drug_labeling_tools.json +544 -168
- tooluniverse/data/fda_drugs_with_brand_generic_names_for_tool.py +76929 -148860
- tooluniverse/data/finder_tools.json +209 -0
- tooluniverse/data/gene_ontology_tools.json +113 -0
- tooluniverse/data/gwas_tools.json +1082 -0
- tooluniverse/data/hpa_tools.json +333 -0
- tooluniverse/data/humanbase_tools.json +47 -0
- tooluniverse/data/idmap_tools.json +74 -0
- tooluniverse/data/mcp_client_tools_example.json +113 -0
- tooluniverse/data/mcpautoloadertool_defaults.json +28 -0
- tooluniverse/data/medlineplus_tools.json +141 -0
- tooluniverse/data/monarch_tools.json +1 -1
- tooluniverse/data/openalex_tools.json +36 -0
- tooluniverse/data/opentarget_tools.json +82 -58
- tooluniverse/data/output_summarization_tools.json +101 -0
- tooluniverse/data/packages/bioinformatics_core_tools.json +1756 -0
- tooluniverse/data/packages/categorized_tools.txt +206 -0
- tooluniverse/data/packages/cheminformatics_tools.json +347 -0
- tooluniverse/data/packages/earth_sciences_tools.json +74 -0
- tooluniverse/data/packages/genomics_tools.json +776 -0
- tooluniverse/data/packages/image_processing_tools.json +38 -0
- tooluniverse/data/packages/machine_learning_tools.json +789 -0
- tooluniverse/data/packages/neuroscience_tools.json +62 -0
- tooluniverse/data/packages/original_tools.txt +0 -0
- tooluniverse/data/packages/physics_astronomy_tools.json +62 -0
- tooluniverse/data/packages/scientific_computing_tools.json +560 -0
- tooluniverse/data/packages/single_cell_tools.json +453 -0
- tooluniverse/data/packages/software_tools.json +4954 -0
- tooluniverse/data/packages/structural_biology_tools.json +396 -0
- tooluniverse/data/packages/visualization_tools.json +399 -0
- tooluniverse/data/pubchem_tools.json +215 -0
- tooluniverse/data/pubtator_tools.json +68 -0
- tooluniverse/data/rcsb_pdb_tools.json +1332 -0
- tooluniverse/data/reactome_tools.json +19 -0
- tooluniverse/data/semantic_scholar_tools.json +26 -0
- tooluniverse/data/special_tools.json +2 -25
- tooluniverse/data/tool_composition_tools.json +88 -0
- tooluniverse/data/toolfinderkeyword_defaults.json +34 -0
- tooluniverse/data/txagent_client_tools.json +9 -0
- tooluniverse/data/uniprot_tools.json +211 -0
- tooluniverse/data/url_fetch_tools.json +94 -0
- tooluniverse/data/uspto_downloader_tools.json +9 -0
- tooluniverse/data/uspto_tools.json +811 -0
- tooluniverse/data/xml_tools.json +3275 -0
- tooluniverse/dataset_tool.py +296 -0
- tooluniverse/default_config.py +165 -0
- tooluniverse/efo_tool.py +42 -0
- tooluniverse/embedding_database.py +630 -0
- tooluniverse/embedding_sync.py +396 -0
- tooluniverse/enrichr_tool.py +266 -0
- tooluniverse/europe_pmc_tool.py +52 -0
- tooluniverse/execute_function.py +1775 -95
- tooluniverse/extended_hooks.py +444 -0
- tooluniverse/gene_ontology_tool.py +194 -0
- tooluniverse/graphql_tool.py +158 -36
- tooluniverse/gwas_tool.py +358 -0
- tooluniverse/hpa_tool.py +1645 -0
- tooluniverse/humanbase_tool.py +389 -0
- tooluniverse/logging_config.py +254 -0
- tooluniverse/mcp_client_tool.py +764 -0
- tooluniverse/mcp_integration.py +413 -0
- tooluniverse/mcp_tool_registry.py +925 -0
- tooluniverse/medlineplus_tool.py +337 -0
- tooluniverse/openalex_tool.py +228 -0
- tooluniverse/openfda_adv_tool.py +283 -0
- tooluniverse/openfda_tool.py +393 -160
- tooluniverse/output_hook.py +1122 -0
- tooluniverse/package_tool.py +195 -0
- tooluniverse/pubchem_tool.py +158 -0
- tooluniverse/pubtator_tool.py +168 -0
- tooluniverse/rcsb_pdb_tool.py +38 -0
- tooluniverse/reactome_tool.py +108 -0
- tooluniverse/remote/boltz/boltz_mcp_server.py +50 -0
- tooluniverse/remote/depmap_24q2/depmap_24q2_mcp_tool.py +442 -0
- tooluniverse/remote/expert_feedback/human_expert_mcp_tools.py +2013 -0
- tooluniverse/remote/expert_feedback/simple_test.py +23 -0
- tooluniverse/remote/expert_feedback/start_web_interface.py +188 -0
- tooluniverse/remote/expert_feedback/web_only_interface.py +0 -0
- tooluniverse/remote/expert_feedback_mcp/human_expert_mcp_server.py +1611 -0
- tooluniverse/remote/expert_feedback_mcp/simple_test.py +34 -0
- tooluniverse/remote/expert_feedback_mcp/start_web_interface.py +91 -0
- tooluniverse/remote/immune_compass/compass_tool.py +327 -0
- tooluniverse/remote/pinnacle/pinnacle_tool.py +328 -0
- tooluniverse/remote/transcriptformer/transcriptformer_tool.py +586 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_mcp_server.py +61 -0
- tooluniverse/remote/uspto_downloader/uspto_downloader_tool.py +120 -0
- tooluniverse/remote_tool.py +99 -0
- tooluniverse/restful_tool.py +53 -30
- tooluniverse/scripts/generate_tool_graph.py +408 -0
- tooluniverse/scripts/visualize_tool_graph.py +829 -0
- tooluniverse/semantic_scholar_tool.py +62 -0
- tooluniverse/smcp.py +2452 -0
- tooluniverse/smcp_server.py +975 -0
- tooluniverse/test/mcp_server_test.py +0 -0
- tooluniverse/test/test_admetai_tool.py +370 -0
- tooluniverse/test/test_agentic_tool.py +129 -0
- tooluniverse/test/test_alphafold_tool.py +71 -0
- tooluniverse/test/test_chem_tool.py +37 -0
- tooluniverse/test/test_compose_lieraturereview.py +63 -0
- tooluniverse/test/test_compose_tool.py +448 -0
- tooluniverse/test/test_dailymed.py +69 -0
- tooluniverse/test/test_dataset_tool.py +200 -0
- tooluniverse/test/test_disease_target_score.py +56 -0
- tooluniverse/test/test_drugbank_filter_examples.py +179 -0
- tooluniverse/test/test_efo.py +31 -0
- tooluniverse/test/test_enrichr_tool.py +21 -0
- tooluniverse/test/test_europe_pmc_tool.py +20 -0
- tooluniverse/test/test_fda_adv.py +95 -0
- tooluniverse/test/test_fda_drug_labeling.py +91 -0
- tooluniverse/test/test_gene_ontology_tools.py +66 -0
- tooluniverse/test/test_gwas_tool.py +139 -0
- tooluniverse/test/test_hpa.py +625 -0
- tooluniverse/test/test_humanbase_tool.py +20 -0
- tooluniverse/test/test_idmap_tools.py +61 -0
- tooluniverse/test/test_mcp_server.py +211 -0
- tooluniverse/test/test_mcp_tool.py +247 -0
- tooluniverse/test/test_medlineplus.py +220 -0
- tooluniverse/test/test_openalex_tool.py +32 -0
- tooluniverse/test/test_opentargets.py +28 -0
- tooluniverse/test/test_pubchem_tool.py +116 -0
- tooluniverse/test/test_pubtator_tool.py +37 -0
- tooluniverse/test/test_rcsb_pdb_tool.py +86 -0
- tooluniverse/test/test_reactome.py +54 -0
- tooluniverse/test/test_semantic_scholar_tool.py +24 -0
- tooluniverse/test/test_software_tools.py +147 -0
- tooluniverse/test/test_tool_description_optimizer.py +49 -0
- tooluniverse/test/test_tool_finder.py +26 -0
- tooluniverse/test/test_tool_finder_llm.py +252 -0
- tooluniverse/test/test_tools_find.py +195 -0
- tooluniverse/test/test_uniprot_tools.py +74 -0
- tooluniverse/test/test_uspto_tool.py +72 -0
- tooluniverse/test/test_xml_tool.py +113 -0
- tooluniverse/tool_finder_embedding.py +267 -0
- tooluniverse/tool_finder_keyword.py +693 -0
- tooluniverse/tool_finder_llm.py +699 -0
- tooluniverse/tool_graph_web_ui.py +955 -0
- tooluniverse/tool_registry.py +416 -0
- tooluniverse/uniprot_tool.py +155 -0
- tooluniverse/url_tool.py +253 -0
- tooluniverse/uspto_tool.py +240 -0
- tooluniverse/utils.py +369 -41
- tooluniverse/xml_tool.py +369 -0
- tooluniverse-1.0.0.dist-info/METADATA +377 -0
- tooluniverse-1.0.0.dist-info/RECORD +186 -0
- {tooluniverse-0.1.4.dist-info ā tooluniverse-1.0.0.dist-info}/WHEEL +1 -1
- tooluniverse-1.0.0.dist-info/entry_points.txt +9 -0
- tooluniverse-0.1.4.dist-info/METADATA +0 -141
- tooluniverse-0.1.4.dist-info/RECORD +0 -18
- {tooluniverse-0.1.4.dist-info ā tooluniverse-1.0.0.dist-info}/licenses/LICENSE +0 -0
- {tooluniverse-0.1.4.dist-info ā tooluniverse-1.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Simple Test for Human Expert System
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from tooluniverse import ToolUniverse
|
|
7
|
+
|
|
8
|
+
tooluni = ToolUniverse()
|
|
9
|
+
tooluni.load_tools()
|
|
10
|
+
|
|
11
|
+
# Submit question to expert
|
|
12
|
+
result = tooluni.run(
|
|
13
|
+
{
|
|
14
|
+
"name": "expert_consult_human_expert",
|
|
15
|
+
"arguments": {
|
|
16
|
+
"question": "What is the recommended dosage of aspirin for elderly patients?",
|
|
17
|
+
"specialty": "cardiology",
|
|
18
|
+
"priority": "high", # normal, high, urgent
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
print("Request submitted. Result:")
|
|
23
|
+
print(result)
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Start Web Interface Only
|
|
4
|
+
|
|
5
|
+
This script starts only the web interface for expert consultations using the
|
|
6
|
+
@register_mcp_tool system (human_expert_mcp_tools.py).
|
|
7
|
+
The MCP server must be running separately.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
import requests
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
import os
|
|
15
|
+
import socket
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_random_port():
|
|
19
|
+
"""Get a random available port"""
|
|
20
|
+
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
21
|
+
s.bind(("", 0))
|
|
22
|
+
return s.getsockname()[1]
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def detect_mcp_server_port():
|
|
26
|
+
"""Ask user for MCP server connection details"""
|
|
27
|
+
print("š Please provide the MCP server connection details:")
|
|
28
|
+
|
|
29
|
+
while True:
|
|
30
|
+
try:
|
|
31
|
+
address = input("Enter server IP address (default: localhost): ").strip()
|
|
32
|
+
if not address:
|
|
33
|
+
address = "localhost"
|
|
34
|
+
|
|
35
|
+
port_input = input("Enter server port (default: 9877): ").strip()
|
|
36
|
+
if not port_input:
|
|
37
|
+
port = 9876
|
|
38
|
+
else:
|
|
39
|
+
port = int(port_input)
|
|
40
|
+
|
|
41
|
+
# Validate port range
|
|
42
|
+
if not (1 <= port <= 65535):
|
|
43
|
+
print("ā Port must be between 1 and 65535. Please try again.")
|
|
44
|
+
continue
|
|
45
|
+
|
|
46
|
+
# Test the connection
|
|
47
|
+
print(f"š Testing connection to {address}:{port}...")
|
|
48
|
+
if check_mcp_server_on_port(port, address):
|
|
49
|
+
print(f"ā
Successfully connected to {address}:{port}")
|
|
50
|
+
# Set the environment variable for this session
|
|
51
|
+
os.environ["EXPERT_FEEDBACK_MCP_SERVER_URL"] = (
|
|
52
|
+
f"http://{address}:{port}"
|
|
53
|
+
)
|
|
54
|
+
return port
|
|
55
|
+
else:
|
|
56
|
+
print(f"ā Could not connect to {address}:{port}")
|
|
57
|
+
print("š” Make sure the MCP server is running and accessible")
|
|
58
|
+
print(" Server logs should show something like:")
|
|
59
|
+
print(" 'INFO: Uvicorn running on http://0.0.0.0:9876'")
|
|
60
|
+
retry = input("Would you like to try again? (y/N): ").strip().lower()
|
|
61
|
+
if retry != "y":
|
|
62
|
+
break
|
|
63
|
+
|
|
64
|
+
except ValueError:
|
|
65
|
+
print("ā Invalid port number. Please enter a valid integer.")
|
|
66
|
+
except KeyboardInterrupt:
|
|
67
|
+
print("\nš Cancelled by user")
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
# Try common ports that the system might use
|
|
71
|
+
print("š Trying common ports...")
|
|
72
|
+
common_ports = [8000, 8001] + [52340 + i for i in range(20)]
|
|
73
|
+
|
|
74
|
+
for port in common_ports:
|
|
75
|
+
if check_mcp_server_on_port(port):
|
|
76
|
+
print(f"ā
Found MCP server running on port {port}")
|
|
77
|
+
return port
|
|
78
|
+
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def check_mcp_server_on_port(port, address="localhost"):
|
|
83
|
+
"""Check if MCP server is running on specific port and address"""
|
|
84
|
+
try:
|
|
85
|
+
# Try different possible endpoints
|
|
86
|
+
endpoints_to_try = [
|
|
87
|
+
f"http://{address}:{port}/tools/get_expert_status",
|
|
88
|
+
f"http://{address}:{port}/mcp",
|
|
89
|
+
f"http://{address}:{port}/tools",
|
|
90
|
+
f"http://{address}:{port}/",
|
|
91
|
+
f"http://{address}:{port}/docs",
|
|
92
|
+
f"http://{address}:{port}/health",
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
for endpoint in endpoints_to_try:
|
|
96
|
+
try:
|
|
97
|
+
if "/tools/get_expert_status" in endpoint:
|
|
98
|
+
response = requests.post(endpoint, json={}, timeout=2)
|
|
99
|
+
else:
|
|
100
|
+
response = requests.get(endpoint, timeout=2)
|
|
101
|
+
|
|
102
|
+
# Accept various response codes that indicate server is running
|
|
103
|
+
if response.status_code in [200, 404, 405, 406, 422, 500]:
|
|
104
|
+
print(
|
|
105
|
+
f"ā
Server detected at {endpoint} (status: {response.status_code})"
|
|
106
|
+
)
|
|
107
|
+
return True
|
|
108
|
+
|
|
109
|
+
except requests.exceptions.RequestException:
|
|
110
|
+
continue
|
|
111
|
+
|
|
112
|
+
except Exception as e:
|
|
113
|
+
print(f"ā ļø Connection test error: {e}")
|
|
114
|
+
|
|
115
|
+
return False
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def check_mcp_server():
|
|
119
|
+
"""Check if MCP server is running and return port"""
|
|
120
|
+
print("š Detecting MCP server...")
|
|
121
|
+
port = detect_mcp_server_port()
|
|
122
|
+
if port:
|
|
123
|
+
print(f"ā
MCP Server detected on port {port}")
|
|
124
|
+
return port
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
def main():
|
|
129
|
+
print("š Starting Human Expert Web Interface")
|
|
130
|
+
print("=" * 50)
|
|
131
|
+
|
|
132
|
+
# Check if MCP server is running
|
|
133
|
+
mcp_port = check_mcp_server()
|
|
134
|
+
if not mcp_port:
|
|
135
|
+
print("ā Second generation MCP Server not detected!")
|
|
136
|
+
print("š” Please start the MCP server first:")
|
|
137
|
+
print(" python human_expert_mcp_tools.py --start-server")
|
|
138
|
+
print()
|
|
139
|
+
print("š” This script only supports the modern @register_mcp_tool system.")
|
|
140
|
+
print()
|
|
141
|
+
choice = input("Continue anyway? (y/N): ").strip().lower()
|
|
142
|
+
if choice != "y":
|
|
143
|
+
return 1
|
|
144
|
+
|
|
145
|
+
# Check for the second generation script
|
|
146
|
+
modern_script = Path(__file__).parent / "human_expert_mcp_tools.py"
|
|
147
|
+
|
|
148
|
+
if not modern_script.exists():
|
|
149
|
+
print("ā MCP tools script not found!")
|
|
150
|
+
print(f" Looking for: {modern_script}")
|
|
151
|
+
print(" Make sure human_expert_mcp_tools.py exists in this directory.")
|
|
152
|
+
return 1
|
|
153
|
+
|
|
154
|
+
print("š Using @register_mcp_tool system")
|
|
155
|
+
if mcp_port:
|
|
156
|
+
print(f"š MCP Server: localhost:{mcp_port}")
|
|
157
|
+
|
|
158
|
+
print("š Starting web interface...")
|
|
159
|
+
print("š„ļø Browser should open automatically")
|
|
160
|
+
print("\nPress Ctrl+C to stop")
|
|
161
|
+
print("=" * 60)
|
|
162
|
+
|
|
163
|
+
try:
|
|
164
|
+
# Check Flask availability
|
|
165
|
+
try:
|
|
166
|
+
pass
|
|
167
|
+
|
|
168
|
+
print("ā
Flask is available")
|
|
169
|
+
except ImportError:
|
|
170
|
+
print("ā Flask not found. Install with: pip install flask")
|
|
171
|
+
return 1
|
|
172
|
+
|
|
173
|
+
# Start web interface
|
|
174
|
+
subprocess.run(
|
|
175
|
+
[sys.executable, str(modern_script), "--web-only", "--no-browser"]
|
|
176
|
+
)
|
|
177
|
+
return 0
|
|
178
|
+
|
|
179
|
+
except KeyboardInterrupt:
|
|
180
|
+
print("\nš Web Interface stopped")
|
|
181
|
+
return 0
|
|
182
|
+
except Exception as e:
|
|
183
|
+
print(f"ā Error starting web interface: {str(e)}")
|
|
184
|
+
return 1
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
if __name__ == "__main__":
|
|
188
|
+
sys.exit(main())
|
|
File without changes
|