forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_setup.py
More file actions
101 lines (78 loc) · 2.7 KB
/
Copy pathtest_setup.py
File metadata and controls
101 lines (78 loc) · 2.7 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/usr/bin/env python3
"""
Test script to verify the setup of the OMI-Composio integration plugin.
"""
import os
import sys
from dotenv import load_dotenv
def check_environment():
"""Check if the required environment variables are set."""
load_dotenv(verbose=True)
required_vars = [
'OMI_APP_ID',
'OMI_API_KEY',
'NOTION_CLIENT_ID',
'NOTION_CLIENT_SECRET',
'NOTION_REDIRECT_URI',
]
missing_vars = [var for var in required_vars if not os.getenv(var)]
if missing_vars:
print("❌ Missing environment variables:")
for var in missing_vars:
print(f" - {var}")
print("\nPlease create a .env file with these variables. See .env.template for reference.")
else:
print("✅ All required environment variables are set.")
return len(missing_vars) == 0
def check_dependencies():
"""Check if the required dependencies are installed."""
try:
import fastapi
import uvicorn
import jinja2
import requests
print("✅ All required dependencies are installed.")
return True
except ImportError as e:
print(f"❌ Missing dependency: {e}")
print("\nPlease install the required dependencies with:")
print(" pip install -r requirements.txt")
return False
def check_directories():
"""Check if the required directories exist."""
required_dirs = [
'templates',
'static',
'src',
'data',
]
missing_dirs = [dir for dir in required_dirs if not os.path.isdir(dir)]
if missing_dirs:
print("❌ Missing directories:")
for dir in missing_dirs:
print(f" - {dir}")
# Create the directory
os.makedirs(dir, exist_ok=True)
print(f" ✓ Created {dir} directory")
else:
print("✅ All required directories exist.")
return len(missing_dirs) == 0
def main():
"""Run all checks."""
print("====== OMI-Composio Integration Setup Check ======\n")
# Ensure we're in the right directory
if not os.path.exists('requirements.txt'):
print("❌ Please run this script from the plugin root directory (plugins/composio)")
return False
env_ok = check_environment()
deps_ok = check_dependencies()
dirs_ok = check_directories()
print("\n====== Summary ======")
if env_ok and deps_ok and dirs_ok:
print("✅ Setup complete! You can run the application with:")
print(" uvicorn main:app --reload")
else:
print("❌ Some issues need to be fixed before running the application.")
return env_ok and deps_ok and dirs_ok
if __name__ == "__main__":
sys.exit(0 if main() else 1)