-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_setup.py
More file actions
157 lines (130 loc) · 4.64 KB
/
Copy pathverify_setup.py
File metadata and controls
157 lines (130 loc) · 4.64 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/usr/bin/env python3
"""
Test script to verify the AI Pair-Programmer Interview Room setup
"""
import sys
import os
def check_python_version():
"""Check Python version"""
print("🐍 Checking Python version...")
version = sys.version_info
if version.major >= 3 and version.minor >= 8:
print(f" ✓ Python {version.major}.{version.minor}.{version.micro}")
return True
else:
print(f" ✗ Python {version.major}.{version.minor}.{version.micro} (requires 3.8+)")
return False
def check_dependencies():
"""Check if required Python packages are installed"""
print("\n📦 Checking Python dependencies...")
required_packages = [
'fastapi',
'uvicorn',
'langchain',
'langgraph',
'crewai',
'openai',
'dotenv'
]
all_installed = True
for package in required_packages:
try:
__import__(package)
print(f" ✓ {package}")
except ImportError:
print(f" ✗ {package} (not installed)")
all_installed = False
return all_installed
def check_env_file():
"""Check if .env file exists and has required variables"""
print("\n🔐 Checking environment configuration...")
if not os.path.exists('.env'):
print(" ✗ .env file not found")
print(" Run: cp .env.example .env")
return False
print(" ✓ .env file exists")
with open('.env', 'r') as f:
content = f.read()
env_valid = True
if 'GROQ_API_KEY=your_groq_api_key_here' in content or 'GROQ_API_KEY=' not in content:
print(" ⚠️ GROQ_API_KEY not set in .env")
print(" Get your key at: https://console.groq.com")
env_valid = False
else:
print(" ✓ GROQ_API_KEY configured")
optional_keys = [
("MISTRAL_API_KEY", "https://console.mistral.ai"),
("GOOGLE_GEMINI_API_KEY", "https://console.cloud.google.com/vertex-ai")
]
for key, source in optional_keys:
if f"{key}=your" in content or f"{key}=" not in content:
print(f" ⚠️ {key} not set in .env (multi-LLM benefits will be limited)")
print(f" Get credentials at: {source}")
else:
print(f" ✓ {key} configured")
return env_valid
def check_backend_structure():
"""Check if backend files exist"""
print("\n📂 Checking backend structure...")
required_files = [
'backend/__init__.py',
'backend/main.py',
'backend/workflows/interview_graph.py',
'backend/agents/evaluation_crew.py',
'backend/services/code_executor.py',
'backend/services/session_manager.py'
]
all_exist = True
for file in required_files:
if os.path.exists(file):
print(f" ✓ {file}")
else:
print(f" ✗ {file}")
all_exist = False
return all_exist
def check_frontend_structure():
"""Check if frontend files exist"""
print("\n⚛️ Checking frontend structure...")
required_files = [
'client/package.json',
'client/src/App.js',
'client/src/components/StartScreen.js',
'client/src/components/InterviewRoom.js',
'client/src/components/EvaluationReport.js'
]
all_exist = True
for file in required_files:
if os.path.exists(file):
print(f" ✓ {file}")
else:
print(f" ✗ {file}")
all_exist = False
return all_exist
def main():
print("=" * 60)
print("AI Pair-Programmer Interview Room - Setup Verification")
print("=" * 60)
checks = [
check_python_version(),
check_dependencies(),
check_env_file(),
check_backend_structure(),
check_frontend_structure()
]
print("\n" + "=" * 60)
if all(checks):
print("✅ All checks passed! You're ready to go.")
print("\nNext steps:")
print("1. Make sure GROQ_API_KEY, MISTRAL_API_KEY, and GOOGLE_GEMINI_API_KEY are set in .env (see README)")
print("2. Start backend: source venv/bin/activate && uvicorn backend.main:app --reload")
print("3. Start frontend: cd client && npm start")
print("4. Open http://localhost:3000")
else:
print("❌ Some checks failed. Please review the errors above.")
print("\nTo fix issues:")
print("1. Run ./setup.sh to install dependencies")
print("2. Create .env from .env.example and add your Groq, Mistral, and Gemini API keys")
print("3. Verify all files are present")
print("=" * 60)
if __name__ == "__main__":
main()