forked from mims-harvard/ToolUniverse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathefo_example.py
More file actions
31 lines (28 loc) · 888 Bytes
/
Copy pathefo_example.py
File metadata and controls
31 lines (28 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from tooluniverse import ToolUniverse
# Step 1: Initialize tool universe
tooluni = ToolUniverse()
tooluni.load_tools()
# Step 2: Define test queries for the ChEMBLTool
test_queries = [
{
"name": "OSL_get_efo_id_by_disease_name",
"arguments": {"disease": "Bardet Biedl syndrome"},
},
{
"name": "OSL_get_efo_id_by_disease_name",
"arguments": {"disease": "Bardet-Biedl syndrome"},
},
]
# Step 3: Run all test queries
for idx, query in enumerate(test_queries):
# try:
print(
f"\n[{idx+1}] Running tool: {query['name']} with arguments: {query['arguments']}"
)
result = tooluni.run(query)
print("✅ Success. Example output snippet:")
print(
result if isinstance(result, dict) else str(result)
) # Print snippet if result is big
# except Exception as e:
# print(f"❌ Failed. Error: {str(e)}")