-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate_setup.py
More file actions
166 lines (131 loc) · 4.34 KB
/
validate_setup.py
File metadata and controls
166 lines (131 loc) · 4.34 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
158
159
160
161
162
163
164
165
166
#!/usr/bin/env python3
"""
Validate orchestrator setup without making API calls.
Checks:
- Python imports work
- Configuration files exist
- Prompts are loadable
- Directory structure is correct
"""
import os
import sys
from pathlib import Path
def check_imports():
"""Test that all orchestrator modules can be imported."""
print("✓ Checking imports...")
try:
from orchestrator import WorkflowEngine, AgentRunner, LLMClient, StateStore
print(" ✓ All orchestrator modules imported successfully")
return True
except Exception as e:
print(f" ✗ Import failed: {e}")
return False
def check_config_files():
"""Check that configuration files exist."""
print("\n✓ Checking configuration files...")
required_files = [
"config/agents.yaml",
"prompts/requirements_gatherer.md",
"prompts/workflow_orchestrator.md",
"prompts/context_manager.md",
]
all_exist = True
for file_path in required_files:
if Path(file_path).exists():
print(f" ✓ {file_path}")
else:
print(f" ✗ {file_path} NOT FOUND")
all_exist = False
return all_exist
def check_directory_structure():
"""Check that required directories exist."""
print("\n✓ Checking directory structure...")
required_dirs = [
"orchestrator",
"prompts",
"config",
"context",
"kanban",
"workflow",
"logs",
]
all_exist = True
for dir_path in required_dirs:
if Path(dir_path).exists():
print(f" ✓ {dir_path}/")
else:
print(f" ✗ {dir_path}/ NOT FOUND")
all_exist = False
return all_exist
def check_prompt_loading():
"""Test loading an agent prompt."""
print("\n✓ Checking prompt loading...")
try:
# Import modules without creating LLM client
import yaml
from pathlib import Path
# Load config
with open("config/agents.yaml", 'r') as f:
config = yaml.safe_load(f)
agents = config.get('agents', {})
# Get prompt file for requirements_gatherer
agent_config = agents.get('requirements_gatherer', {})
prompt_file = agent_config.get('prompt_file', '')
# Try to load the prompt file directly
prompt_path = Path("prompts") / "requirements_gatherer.md"
if not prompt_path.exists():
print(f" ✗ Prompt file not found: {prompt_path}")
return False
with open(prompt_path, 'r') as f:
prompt = f.read()
if prompt and len(prompt) > 100:
print(f" ✓ requirements_gatherer prompt loaded ({len(prompt)} chars)")
return True
else:
print(f" ✗ Prompt too short or empty")
return False
except Exception as e:
print(f" ✗ Failed to load prompt: {e}")
return False
def check_agent_count():
"""Count available agents."""
print("\n✓ Checking agent registry...")
try:
import yaml
with open("config/agents.yaml", 'r') as f:
config = yaml.safe_load(f)
agents = config.get("agents", {})
count = len(agents)
print(f" ✓ Found {count} agents in configuration")
# List a few
agent_list = list(agents.keys())[:5]
print(f" ✓ Sample agents: {', '.join(agent_list)}...")
return count > 0
except Exception as e:
print(f" ✗ Failed to load agents config: {e}")
return False
def main():
"""Run all validation checks."""
print("=" * 80)
print("Agent Orchestrator - Setup Validation")
print("=" * 80)
checks = [
check_imports(),
check_config_files(),
check_directory_structure(),
check_agent_count(),
check_prompt_loading(),
]
print("\n" + "=" * 80)
if all(checks):
print("✅ All checks passed! Setup is valid.")
print("\nNext steps:")
print(" 1. Set ANTHROPIC_API_KEY environment variable")
print(" 2. Run: python test_agent.py requirements_gatherer")
print("\nSee QUICKSTART.md for detailed instructions.")
return 0
else:
print("❌ Some checks failed. Please fix the issues above.")
return 1
if __name__ == "__main__":
sys.exit(main())