-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject_planner.py
More file actions
59 lines (48 loc) · 2.29 KB
/
project_planner.py
File metadata and controls
59 lines (48 loc) · 2.29 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
from langchain_core.prompts import PromptTemplate
from langchain_classic.chains import LLMChain
from loguru import logger
class ProjectPlanner:
def __init__(self, groq_client):
self.groq_client = groq_client
self._setup_chain()
def _setup_chain(self):
plan_template = """Based on the technical specifications provided, create a detailed project plan that includes clear phases, tasks, and resource allocation.
Technical Specifications:
{tech_specs}
Generate a comprehensive project plan with the following structure:
1. Project Phases:
- Break down into logical phases
- Include duration estimates for each phase
- Specify key milestones and deliverables
- Note dependencies between phases
2. Resource Requirements:
- Required team roles and expertise levels
- Development tools and licenses needed
- Infrastructure and cloud services required
- Testing and deployment resources
3. Implementation Timeline:
- Start and end dates for each phase
- Major milestones and deadlines
- Critical path activities
- Buffer periods for risks
4. Risk Assessment:
- Potential technical challenges
- Resource availability risks
- Timeline impact factors
- Mitigation strategies
Include sufficient detail for accurate cost estimation, such as:
- Time estimates for each phase and major task
- Specific expertise levels required
- Infrastructure components needed
- Third-party tools and services
- Complex integration points
- Performance requirements
- Security considerations"""
self.plan_chain = self.groq_client.create_chain(plan_template)
def generate_plan(self, tech_specs):
"""Generate a detailed project plan from technical specifications."""
try:
return self.plan_chain.run(tech_specs=tech_specs)
except Exception as e:
logger.error(f"Error generating project plan: {str(e)}")
return "Error generating project plan. Please check the inputs and try again."