tooluniverse 1.0.0__py3-none-any.whl → 1.0.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.

@@ -1,34 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Simple Test for Human Expert System
4
- """
5
-
6
- from tooluniverse import ToolUniverse
7
-
8
- # Initialize tool universe
9
- tooluni = ToolUniverse()
10
- tooluni.load_tools()
11
-
12
- # Test queries for expert feedback tools
13
- test_queries = [
14
- {"name": "expert_get_expert_status", "arguments": {}},
15
- {
16
- "name": "expert_consult_human_expert",
17
- "arguments": {
18
- "question": "What is aspirin used for?",
19
- "specialty": "general",
20
- "priority": "normal",
21
- "timeout_minutes": 1,
22
- },
23
- },
24
- ]
25
-
26
- print(tooluni.tool_specification("expert_consult_human_expert"))
27
-
28
- for idx, query in enumerate(test_queries):
29
- print(
30
- f"\n[{idx+1}] Running tool: {query['name']} with arguments: {query['arguments']}"
31
- )
32
- result = tooluni.run(query)
33
- print("✅ Success. Example output snippet:")
34
- print(result if isinstance(result, dict) else str(result))
@@ -1,91 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Start Web Interface Only
4
-
5
- This script starts only the web interface for expert consultations.
6
- The MCP server must be running separately.
7
- """
8
-
9
- import subprocess
10
- import sys
11
- import requests
12
- from pathlib import Path
13
-
14
-
15
- def check_mcp_server():
16
- """Check if MCP server is running"""
17
- try:
18
- # Try the MCP endpoint first (follows redirects)
19
- response = requests.get("http://localhost:7002/mcp/", timeout=10)
20
- if response.status_code in [200, 405, 406]: # 405/406 means endpoint exists
21
- return True
22
-
23
- # Fallback: try without trailing slash
24
- response = requests.get("http://localhost:7002/mcp", timeout=10)
25
- if response.status_code in [200, 405, 406, 307]: # 307 redirect is also OK
26
- return True
27
-
28
- # Last resort: try the tool endpoint
29
- response = requests.post(
30
- "http://localhost:7002/tools/get_expert_status", json={}, timeout=10
31
- )
32
- return response.status_code == 200
33
- except Exception:
34
- return False
35
-
36
-
37
- def main():
38
- print("🌐 Starting Human Expert Web Interface")
39
- print("=" * 50)
40
-
41
- # Check if MCP server is running
42
- print("🔍 Checking for MCP server...")
43
- if not check_mcp_server():
44
- print("❌ MCP Server not detected!")
45
- print("📡 Please start MCP server first:")
46
- print(" python start_mcp_server.py")
47
- print(" or")
48
- print(" python human_expert_mcp_server.py")
49
- print()
50
- choice = input("Continue anyway? (y/N): ").strip().lower()
51
- if choice != "y":
52
- return 1
53
- else:
54
- print("✅ MCP Server is running")
55
-
56
- print("🌐 Web Interface will run on port 8080")
57
- print("🖥️ Browser should open automatically")
58
- print("👨‍⚕️ Expert dashboard will be available at http://localhost:8080")
59
- print("\nPress Ctrl+C to stop")
60
- print("=" * 50)
61
-
62
- # Find the main server script
63
- script_path = Path(__file__).parent / "human_expert_mcp_server.py"
64
-
65
- if not script_path.exists():
66
- print(f"❌ Server script not found: {script_path}")
67
- return 1
68
-
69
- try:
70
- # Check Flask availability
71
- try:
72
- pass
73
-
74
- print("✅ Flask is available")
75
- except ImportError:
76
- print("❌ Flask not found. Install with: pip install flask")
77
- return 1
78
-
79
- # Start web interface only
80
- subprocess.run([sys.executable, str(script_path), "--web-only"])
81
- return 0
82
- except KeyboardInterrupt:
83
- print("\n👋 Web Interface stopped")
84
- return 0
85
- except Exception as e:
86
- print(f"❌ Error starting web interface: {str(e)}")
87
- return 1
88
-
89
-
90
- if __name__ == "__main__":
91
- sys.exit(main())