Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -10,22 +10,39 @@ model = HfApiModel(
|
|
10 |
custom_role_conversions=None,
|
11 |
)
|
12 |
|
13 |
-
|
14 |
class ProjectScopingTool(Tool):
|
15 |
name = "project_scoping_tool"
|
16 |
description = """
|
17 |
Handles project scoping by collecting key details such as type, domain, budget, and timeline.
|
18 |
"""
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
"
|
23 |
-
"
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
"""
|
30 |
Collects and structures project details from user input.
|
31 |
"""
|
@@ -37,13 +54,23 @@ class ProjectScopingTool(Tool):
|
|
37 |
}
|
38 |
return json.dumps(self.project_details, indent=2)
|
39 |
|
40 |
-
|
41 |
class TechnicalArchitectureTool(Tool):
|
42 |
name = "technical_architecture_tool"
|
43 |
description = """
|
44 |
Determines the appropriate technical architecture based on the project type.
|
45 |
"""
|
46 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
architectures = {
|
48 |
"web": {
|
49 |
"frontend": ["React", "Next.js", "Tailwind"],
|
@@ -63,13 +90,27 @@ class TechnicalArchitectureTool(Tool):
|
|
63 |
}
|
64 |
return json.dumps(architectures.get(project_type, "Invalid project type"), indent=2)
|
65 |
|
66 |
-
|
67 |
class CostEstimationTool(Tool):
|
68 |
name = "cost_estimation_tool"
|
69 |
description = """
|
70 |
Estimates the cost based on the architecture complexity and timeline.
|
71 |
"""
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
base_costs = {
|
74 |
"development": 5000 * (architecture_size * 0.5),
|
75 |
"infrastructure": 500 * (architecture_size * 0.3),
|
@@ -78,13 +119,18 @@ class CostEstimationTool(Tool):
|
|
78 |
total_cost = sum(base_costs.values())
|
79 |
return json.dumps({"total_estimated_cost": total_cost, "breakdown": base_costs}, indent=2)
|
80 |
|
81 |
-
|
82 |
class DeploymentTool(Tool):
|
83 |
name = "deployment_tool"
|
84 |
description = """
|
85 |
Suggests a deployment strategy based on best practices.
|
86 |
"""
|
87 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
return json.dumps({
|
89 |
"container_strategy": "Docker + Kubernetes",
|
90 |
"cloud_provider": "AWS",
|
@@ -92,13 +138,23 @@ class DeploymentTool(Tool):
|
|
92 |
"ci_cd_pipeline": "GitHub Actions"
|
93 |
}, indent=2)
|
94 |
|
95 |
-
|
96 |
class MeetingPreparationTool(Tool):
|
97 |
name = "meeting_preparation_tool"
|
98 |
description = """
|
99 |
Provides meeting agendas depending on the project stage.
|
100 |
"""
|
101 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
agendas = {
|
103 |
"initial_discovery": [
|
104 |
"Project Vision Validation",
|
|
|
10 |
custom_role_conversions=None,
|
11 |
)
|
12 |
|
|
|
13 |
class ProjectScopingTool(Tool):
|
14 |
name = "project_scoping_tool"
|
15 |
description = """
|
16 |
Handles project scoping by collecting key details such as type, domain, budget, and timeline.
|
17 |
"""
|
18 |
+
|
19 |
+
inputs = {
|
20 |
+
"project_type": {
|
21 |
+
"type": "string",
|
22 |
+
"description": "The type of project (e.g., 'web', 'blockchain', 'ai').",
|
23 |
+
},
|
24 |
+
"domain": {
|
25 |
+
"type": "string",
|
26 |
+
"description": "The industry or field related to the project (e.g., 'finance', 'healthcare').",
|
27 |
+
},
|
28 |
+
"budget_min": {
|
29 |
+
"type": "float",
|
30 |
+
"description": "The minimum budget allocated for the project.",
|
31 |
+
},
|
32 |
+
"budget_max": {
|
33 |
+
"type": "float",
|
34 |
+
"description": "The maximum budget allocated for the project.",
|
35 |
+
},
|
36 |
+
"timeline_months": {
|
37 |
+
"type": "int",
|
38 |
+
"description": "The expected duration of the project in months.",
|
39 |
+
},
|
40 |
+
}
|
41 |
+
|
42 |
+
output_type = "json"
|
43 |
+
|
44 |
+
def forward(self, project_type: str, domain: str, budget_min: float, budget_max: float, timeline_months: int):
|
45 |
+
|
46 |
"""
|
47 |
Collects and structures project details from user input.
|
48 |
"""
|
|
|
54 |
}
|
55 |
return json.dumps(self.project_details, indent=2)
|
56 |
|
|
|
57 |
class TechnicalArchitectureTool(Tool):
|
58 |
name = "technical_architecture_tool"
|
59 |
description = """
|
60 |
Determines the appropriate technical architecture based on the project type.
|
61 |
"""
|
62 |
+
|
63 |
+
inputs = {
|
64 |
+
"project_type": {
|
65 |
+
"type": "string",
|
66 |
+
"description": "The type of project (e.g., 'web', 'blockchain', 'ai').",
|
67 |
+
}
|
68 |
+
}
|
69 |
+
|
70 |
+
output_type = "json"
|
71 |
+
|
72 |
+
def forward(self, project_type: str):
|
73 |
+
|
74 |
architectures = {
|
75 |
"web": {
|
76 |
"frontend": ["React", "Next.js", "Tailwind"],
|
|
|
90 |
}
|
91 |
return json.dumps(architectures.get(project_type, "Invalid project type"), indent=2)
|
92 |
|
|
|
93 |
class CostEstimationTool(Tool):
|
94 |
name = "cost_estimation_tool"
|
95 |
description = """
|
96 |
Estimates the cost based on the architecture complexity and timeline.
|
97 |
"""
|
98 |
+
|
99 |
+
inputs = {
|
100 |
+
"architecture_size": {
|
101 |
+
"type": "int",
|
102 |
+
"description": "The estimated complexity of the architecture on a scale from 1 to 10.",
|
103 |
+
},
|
104 |
+
"timeline_months": {
|
105 |
+
"type": "int",
|
106 |
+
"description": "The project duration in months.",
|
107 |
+
}
|
108 |
+
}
|
109 |
+
|
110 |
+
output_type = "json"
|
111 |
+
|
112 |
+
def forward(self, architecture_size: int, timeline_months: int):
|
113 |
+
|
114 |
base_costs = {
|
115 |
"development": 5000 * (architecture_size * 0.5),
|
116 |
"infrastructure": 500 * (architecture_size * 0.3),
|
|
|
119 |
total_cost = sum(base_costs.values())
|
120 |
return json.dumps({"total_estimated_cost": total_cost, "breakdown": base_costs}, indent=2)
|
121 |
|
|
|
122 |
class DeploymentTool(Tool):
|
123 |
name = "deployment_tool"
|
124 |
description = """
|
125 |
Suggests a deployment strategy based on best practices.
|
126 |
"""
|
127 |
+
|
128 |
+
inputs = {}
|
129 |
+
|
130 |
+
output_type = "json"
|
131 |
+
|
132 |
+
def forward(self):
|
133 |
+
|
134 |
return json.dumps({
|
135 |
"container_strategy": "Docker + Kubernetes",
|
136 |
"cloud_provider": "AWS",
|
|
|
138 |
"ci_cd_pipeline": "GitHub Actions"
|
139 |
}, indent=2)
|
140 |
|
|
|
141 |
class MeetingPreparationTool(Tool):
|
142 |
name = "meeting_preparation_tool"
|
143 |
description = """
|
144 |
Provides meeting agendas depending on the project stage.
|
145 |
"""
|
146 |
+
|
147 |
+
inputs = {
|
148 |
+
"project_stage": {
|
149 |
+
"type": "string",
|
150 |
+
"description": "The current stage of the project (e.g., 'initial_discovery', 'architecture_review').",
|
151 |
+
}
|
152 |
+
}
|
153 |
+
|
154 |
+
output_type = "json"
|
155 |
+
|
156 |
+
def forward(self, project_stage: str):
|
157 |
+
|
158 |
agendas = {
|
159 |
"initial_discovery": [
|
160 |
"Project Vision Validation",
|