Repository navigation
Expand file tree
/
Copy pathexec.sh
More file actions
executable file
·223 lines (160 loc) · 4.27 KB
/
Copy pathexec.sh
File metadata and controls
executable file
·223 lines (160 loc) · 4.27 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
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#!/usr/bin/env python3
from pathlib import Path
def write_doc(path: Path, content: str):
path.write_text(content)
print(f"Generated: {path}")
def main():
docs_path = Path("/home/user/Code/CrewAI/sell_it/docs")
docs_path.mkdir(exist_ok=True)
# MVP Roadmap sections
mvp_day1 = """### Day 1: Foundation
- Project structure setup
- Basic UI components
- Essential state management
- Initial CrewAI setup"""
mvp_day2 = """### Day 2: Core Features
- Research flow implementation
- Basic error handling
- Progress tracking
- Simple data persistence"""
mvp_day3 = """### Day 3: Integration
- Component integration
- State management integration
- CrewAI integration
- Basic testing"""
mvp_content = f"""# MVP Roadmap
## Phase 1: Core Functionality (Days 1-3)
{mvp_day1}
{mvp_day2}
{mvp_day3}"""
# Technical Specs sections
tech_interface = """### 1. Interface Layer
- Components/
- form.py: Input handling
- results.py: Display results
- State/
- manager.py: State management
- main.py: Application entry"""
tech_crew = """### 2. CrewAI Integration
- Research Crew Setup
- Agent Configuration
- Task Processing
- Result Management"""
tech_state = """### 3. State Management
- Session State
- Data Persistence
- Error Handling"""
tech_content = f"""# Technical Specifications
## Component Architecture
{tech_interface}
{tech_crew}
{tech_state}"""
# Development Guide sections
dev_setup = """## Setup
1. Create virtual environment
2. Install dependencies
3. Configure environment variables"""
dev_running = """## Running
1. Activate virtual environment
2. Start Streamlit server
3. Access web interface"""
dev_testing = """## Testing
1. Unit tests
2. Integration tests
3. End-to-end testing"""
dev_content = f"""# Development Guide
{dev_setup}
{dev_running}
{dev_testing}"""
# Write all documents
write_doc(docs_path / "MVP_ROADMAP.md", mvp_content)
write_doc(docs_path / "TECHNICAL_SPECS.md", tech_content)
write_doc(docs_path / "DEVELOPMENT.md", dev_content)
# Add more detailed technical sections
tech_architecture = """## Architecture Overview
- Model-View-Controller pattern
- Event-driven state management
- Asynchronous task processing"""
tech_dependencies = """## Core Dependencies
- streamlit: Web interface
- crewai: Agent orchestration
- langchain: LLM integration
- pydantic: Data validation"""
tech_data_flow = """## Data Flow
1. User Input → Form Validation
2. State Update → Task Creation
3. Agent Processing → Result Generation
4. Result Format → Display Update"""
# Update tech_content to include new sections
tech_content = f"""# Technical Specifications
{tech_architecture}
{tech_dependencies}
{tech_data_flow}
## Component Architecture
{tech_interface}
{tech_crew}
{tech_state}"""
# Add development best practices
dev_practices = """## Best Practices
1. Code Style
- Follow PEP 8
- Use type hints
- Document functions
2. Git Workflow
- Feature branches
- Pull requests
- Semantic versioning
3. Testing Strategy
- Write tests first
- Mock external APIs
- Regular CI runs"""
dev_troubleshooting = """## Troubleshooting
1. Common Issues
- State reset: Clear browser cache
- API errors: Check keys
- Agent timeout: Adjust settings
2. Debugging
- Use st.write for state inspection
- Check logs in .streamlit/
- Enable debug mode"""
# Update dev_content to include new sections
dev_content = f"""# Development Guide
{dev_setup}
{dev_running}
{dev_testing}
{dev_practices}
{dev_troubleshooting}"""
# Add API reference
tech_api = """## API Reference
### CrewAI Integration
```python
from crewai import Agent, Task, Crew
# Basic agent setup
researcher = Agent(
role="Researcher",
goal="Research item details",
backstory="Expert in market analysis"
)
# Simple task creation
task = Task(
description="Research market details",
agent=researcher
)
# Crew assembly
crew = Crew(
agents=[researcher],
tasks=[task]
)
```"""
# Update tech_content one final time
tech_content = f"""# Technical Specifications
{tech_architecture}
{tech_dependencies}
{tech_data_flow}
## Component Architecture
{tech_interface}
{tech_crew}
{tech_state}
{tech_api}"""
if __name__ == "__main__":
main()