Spaces:
Runtime error
Runtime error
ICAS03 commited on
Commit ·
285d72c
1
Parent(s): 6bd39eb
- make output display dynamically
Browse files- Project.py +77 -1
- app.py +125 -106
- common_functions_v4.py +2 -6
- engage_prompts_config.py +0 -1125
- event_handler.py +107 -0
- event_handlers.py +0 -133
- page_prompts_config.py +0 -938
- prompt_configs.py +134 -26
Project.py
CHANGED
|
@@ -92,6 +92,7 @@ class Project:
|
|
| 92 |
'dev_mandays_output_id': lambda self: self.dev_mandays_output_id,
|
| 93 |
}
|
| 94 |
|
|
|
|
| 95 |
def execute_prompt(self, prompt_name: str, input_variables: Dict[str, Any] = None) -> str:
|
| 96 |
"""Execute a prompt with given input variables"""
|
| 97 |
if prompt_name not in PROMPTS:
|
|
@@ -202,4 +203,79 @@ class Project:
|
|
| 202 |
"project_detail": self.get_project_detail()
|
| 203 |
}
|
| 204 |
)
|
| 205 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
'dev_mandays_output_id': lambda self: self.dev_mandays_output_id,
|
| 93 |
}
|
| 94 |
|
| 95 |
+
#Execute prompt with given input variables
|
| 96 |
def execute_prompt(self, prompt_name: str, input_variables: Dict[str, Any] = None) -> str:
|
| 97 |
"""Execute a prompt with given input variables"""
|
| 98 |
if prompt_name not in PROMPTS:
|
|
|
|
| 203 |
"project_detail": self.get_project_detail()
|
| 204 |
}
|
| 205 |
)
|
| 206 |
+
|
| 207 |
+
## Generate PRD and components from project details ##
|
| 208 |
+
def generate_prd_and_components(self, progress=gr.Progress()):
|
| 209 |
+
"""Generate PRD and components from project details, yielding results one by one"""
|
| 210 |
+
|
| 211 |
+
print("\nGenerating PRD...")
|
| 212 |
+
prd_response = self.execute_prompt(
|
| 213 |
+
"generate_prd",
|
| 214 |
+
{
|
| 215 |
+
"project_detail": self.get_project_detail()
|
| 216 |
+
}
|
| 217 |
+
)
|
| 218 |
+
|
| 219 |
+
# Parse the PRD JSON response
|
| 220 |
+
try:
|
| 221 |
+
prd_json = json.loads(prd_response)
|
| 222 |
+
self.generated_prd = prd_json.get("detailed_breakdown", "")
|
| 223 |
+
except json.JSONDecodeError:
|
| 224 |
+
print("Warning: Could not parse PRD as JSON, using raw response")
|
| 225 |
+
self.generated_prd = prd_response
|
| 226 |
+
|
| 227 |
+
# Yield PRD result
|
| 228 |
+
yield ("generate_prd", self.generated_prd)
|
| 229 |
+
|
| 230 |
+
try:
|
| 231 |
+
print("\nAnalyzing configuration with component agent...")
|
| 232 |
+
configuration_output = self.execute_prompt(
|
| 233 |
+
"component_agent",
|
| 234 |
+
{
|
| 235 |
+
"generated_prd": self.generated_prd
|
| 236 |
+
}
|
| 237 |
+
)
|
| 238 |
+
|
| 239 |
+
# Print the raw configuration output for debugging
|
| 240 |
+
print("\nRaw configuration output:")
|
| 241 |
+
print(configuration_output)
|
| 242 |
+
|
| 243 |
+
# Try to parse configuration output
|
| 244 |
+
try:
|
| 245 |
+
cleaned_output = configuration_output
|
| 246 |
+
if "```json" in cleaned_output:
|
| 247 |
+
cleaned_output = cleaned_output.split("```json")[1].split("```")[0].strip()
|
| 248 |
+
elif "```" in cleaned_output:
|
| 249 |
+
cleaned_output = cleaned_output.split("```")[1].split("```")[0].strip()
|
| 250 |
+
|
| 251 |
+
config = json.loads(cleaned_output)
|
| 252 |
+
selected_functions = config[0]["selected_functions"]
|
| 253 |
+
print(f"\nSelected functions: {selected_functions}")
|
| 254 |
+
|
| 255 |
+
except (json.JSONDecodeError, KeyError, IndexError) as e:
|
| 256 |
+
print(f"Warning: Could not parse configuration output ({str(e)}),")
|
| 257 |
+
print(f"Attempted to parse: {cleaned_output}")
|
| 258 |
+
return
|
| 259 |
+
|
| 260 |
+
except Exception as e:
|
| 261 |
+
print(f"Error in analyzing configuration: {str(e)}")
|
| 262 |
+
return
|
| 263 |
+
|
| 264 |
+
# Execute each function and yield results one by one
|
| 265 |
+
for function_name in selected_functions:
|
| 266 |
+
try:
|
| 267 |
+
print(f"\nExecuting {function_name}...")
|
| 268 |
+
result = self.execute_prompt(function_name)
|
| 269 |
+
print(f"Successfully generated result for {function_name}")
|
| 270 |
+
yield (function_name, result)
|
| 271 |
+
|
| 272 |
+
except Exception as e:
|
| 273 |
+
print(f"Error executing {function_name}: {str(e)}")
|
| 274 |
+
yield (function_name, f"Error: {str(e)}")
|
| 275 |
+
continue
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
|
| 279 |
+
|
| 280 |
+
|
| 281 |
+
|
app.py
CHANGED
|
@@ -2,17 +2,17 @@ from typing import Tuple
|
|
| 2 |
import gradio as gr
|
| 3 |
from Project import *
|
| 4 |
from common_functions_v4 import *
|
|
|
|
| 5 |
from google_drive import *
|
| 6 |
from notion import *
|
| 7 |
from state import state
|
| 8 |
-
from
|
| 9 |
from typing import Dict, Any, Tuple
|
| 10 |
import pandas as pd
|
| 11 |
from io import StringIO
|
| 12 |
-
from event_handlers import setup_all_handlers
|
| 13 |
import importlib
|
| 14 |
-
import
|
| 15 |
-
importlib.reload(
|
| 16 |
|
| 17 |
|
| 18 |
def create_ui_component(config: UIConfig, prompt: str = None) -> Any:
|
|
@@ -40,7 +40,7 @@ def create_ui_component(config: UIConfig, prompt: str = None) -> Any:
|
|
| 40 |
)
|
| 41 |
return None
|
| 42 |
|
| 43 |
-
def
|
| 44 |
components = {}
|
| 45 |
|
| 46 |
with gr.Row():
|
|
@@ -86,7 +86,7 @@ def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
|
| 86 |
PROMPTS[prompt_key].prompt = new_prompt.strip()
|
| 87 |
|
| 88 |
# Read current file content
|
| 89 |
-
with open("
|
| 90 |
content = f.read()
|
| 91 |
|
| 92 |
# Find the start of the prompt section
|
|
@@ -135,11 +135,11 @@ def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
|
| 135 |
)
|
| 136 |
|
| 137 |
# Write back to file
|
| 138 |
-
with open("
|
| 139 |
f.write(new_content)
|
| 140 |
|
| 141 |
# Reload the PROMPTS module to update in-memory state
|
| 142 |
-
PROMPTS =
|
| 143 |
|
| 144 |
return "✅ Prompt updated successfully"
|
| 145 |
|
|
@@ -155,57 +155,63 @@ def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
|
| 155 |
|
| 156 |
components[editor_key] = editor
|
| 157 |
components[f"{editor_key}_save_status"] = save_status
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
-
|
| 165 |
-
# Left column for textbox
|
| 166 |
with gr.Column(scale=1):
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
)
|
| 170 |
-
|
| 171 |
-
components[text_key] = text_component
|
| 172 |
-
|
| 173 |
-
# Right column for markdown
|
| 174 |
with gr.Column(scale=1):
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
# Set up the dynamic update only if both components exist
|
| 182 |
-
if text_key in components and markdown_key in components:
|
| 183 |
-
components[text_key].change(
|
| 184 |
-
fn=lambda x: x,
|
| 185 |
-
inputs=[components[text_key]],
|
| 186 |
-
outputs=[components[markdown_key]]
|
| 187 |
)
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
return components
|
| 196 |
|
| 197 |
def create_quotation_generator_section():
|
|
|
|
| 198 |
quotation_cost = None
|
| 199 |
page_recalc_btn = None
|
| 200 |
page_progress_update = None
|
| 201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
with gr.Tab(label="Quotation Generator"):
|
| 203 |
with gr.Row():
|
| 204 |
with gr.Column(scale=2):
|
| 205 |
gr.Markdown("## ⚠️ Instructions #2")
|
| 206 |
for instruction in [
|
| 207 |
-
"1. **Edit System Prompt**:
|
| 208 |
-
"2. **Generate Output**:
|
| 209 |
"3. **Upload Final Documentation**: Give a project name and click upload to Google Drive or Notion",
|
| 210 |
"4. **Recalculate Cost**: Recalculate the cost if you want to change the mandays estimate"
|
| 211 |
]:
|
|
@@ -216,66 +222,58 @@ def create_quotation_generator_section():
|
|
| 216 |
|
| 217 |
with gr.Row():
|
| 218 |
with gr.Column(scale=4):
|
| 219 |
-
|
| 220 |
-
|
| 221 |
for prompt_key, prompt_config in PROMPTS.items():
|
| 222 |
-
# Skip prompts that are chatbot editors
|
| 223 |
if prompt_config.step == "Chatbot Prompt Editors":
|
| 224 |
continue
|
|
|
|
| 225 |
step = prompt_config.step
|
| 226 |
sub_step = prompt_config.sub_step
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
if sub_step:
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
|
|
|
| 238 |
|
| 239 |
all_components = {}
|
| 240 |
step_buttons = {}
|
| 241 |
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
with gr.Accordion(sub_step, open=False):
|
| 254 |
-
for i, prompt_key in enumerate(sub_step_prompts, 1):
|
| 255 |
-
if prompt_key in PROMPTS:
|
| 256 |
-
with gr.Accordion(f"{i}. {PROMPTS[prompt_key].description}", open=False):
|
| 257 |
-
components = create_section_components(PROMPTS[prompt_key])
|
| 258 |
-
all_components[prompt_key] = components
|
| 259 |
-
|
| 260 |
-
with gr.Column(scale=1):
|
| 261 |
-
quotation_cost = gr.Textbox(label="Cost Summary", lines=3, interactive=False)
|
| 262 |
-
page_recalc_btn = gr.Button("Recalculate Cost")
|
| 263 |
-
page_notes_box = gr.Textbox(
|
| 264 |
-
label="Notes",
|
| 265 |
-
lines=3,
|
| 266 |
-
placeholder="Add your notes here..."
|
| 267 |
-
)
|
| 268 |
-
page_save_quotation_btn = gr.Button("Save Quotation with Note")
|
| 269 |
-
else:
|
| 270 |
-
# Regular step button for non-Step 2
|
| 271 |
-
button_label = step_name.split(' : ')[1] if ' : ' in step_name else step_name
|
| 272 |
-
step_buttons[step_name] = gr.Button(f"✅ Generate {button_label}" )
|
| 273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
for prompt_key in prompt_keys:
|
| 275 |
if prompt_key in PROMPTS:
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 279 |
|
| 280 |
with gr.Column(scale=1):
|
| 281 |
with gr.Row():
|
|
@@ -289,20 +287,41 @@ def create_quotation_generator_section():
|
|
| 289 |
with gr.Column(scale=1):
|
| 290 |
page_upload_drive_btn = gr.Button("📁 Upload to Google Drive")
|
| 291 |
page_upload_notion_btn = gr.Button("📝 Upload to Notion")
|
| 292 |
-
|
| 293 |
-
with gr.Tab(label="Guidelines"):
|
| 294 |
-
gr.Markdown("### 🗒️ Note : There are 3 main steps. Each step has sub-steps.")
|
| 295 |
-
for notes in [
|
| 296 |
-
"**Step 1**: Generate General PRD, Plan Test Components, Development Components",
|
| 297 |
-
"**Step 2**: Generate Mandays Estimates & Cost Summary (General & MVP)",
|
| 298 |
-
"**Step 3**: Generate Final Documentation (MVP PRD , BD SOW , Tech SOW)"
|
| 299 |
-
]:
|
| 300 |
-
gr.Markdown(notes)
|
| 301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 302 |
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
|
| 307 |
def update_display_mode(mode: str, text_content: str) -> tuple:
|
| 308 |
return (
|
|
@@ -314,8 +333,8 @@ def update_display_mode(mode: str, text_content: str) -> tuple:
|
|
| 314 |
with open("page_main.css", "r") as file:
|
| 315 |
custom_css = file.read()
|
| 316 |
|
| 317 |
-
with gr.Blocks(title="
|
| 318 |
-
gr.Markdown("#
|
| 319 |
|
| 320 |
all_components = {}
|
| 321 |
|
|
@@ -337,7 +356,7 @@ with gr.Blocks(title="Page Quotation Chatbot (with SOW)", css=custom_css) as pag
|
|
| 337 |
|
| 338 |
for prompt_key, prompt_config in chatbot_prompts.items():
|
| 339 |
with gr.Accordion(prompt_config.description, open=False):
|
| 340 |
-
components =
|
| 341 |
chatbot_editors[prompt_key] = components
|
| 342 |
|
| 343 |
with gr.Row():
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from Project import *
|
| 4 |
from common_functions_v4 import *
|
| 5 |
+
from event_handler import setup_all_handlers
|
| 6 |
from google_drive import *
|
| 7 |
from notion import *
|
| 8 |
from state import state
|
| 9 |
+
from prompt_configs import *
|
| 10 |
from typing import Dict, Any, Tuple
|
| 11 |
import pandas as pd
|
| 12 |
from io import StringIO
|
|
|
|
| 13 |
import importlib
|
| 14 |
+
import prompt_configs
|
| 15 |
+
importlib.reload(prompt_configs)
|
| 16 |
|
| 17 |
|
| 18 |
def create_ui_component(config: UIConfig, prompt: str = None) -> Any:
|
|
|
|
| 40 |
)
|
| 41 |
return None
|
| 42 |
|
| 43 |
+
def create_prompt_editor_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
| 44 |
components = {}
|
| 45 |
|
| 46 |
with gr.Row():
|
|
|
|
| 86 |
PROMPTS[prompt_key].prompt = new_prompt.strip()
|
| 87 |
|
| 88 |
# Read current file content
|
| 89 |
+
with open("prompt_config.py", "r", encoding='utf-8') as f:
|
| 90 |
content = f.read()
|
| 91 |
|
| 92 |
# Find the start of the prompt section
|
|
|
|
| 135 |
)
|
| 136 |
|
| 137 |
# Write back to file
|
| 138 |
+
with open("prompt_config.py", "w", encoding='utf-8') as f:
|
| 139 |
f.write(new_content)
|
| 140 |
|
| 141 |
# Reload the PROMPTS module to update in-memory state
|
| 142 |
+
PROMPTS = prompt_configs.PROMPTS
|
| 143 |
|
| 144 |
return "✅ Prompt updated successfully"
|
| 145 |
|
|
|
|
| 155 |
|
| 156 |
components[editor_key] = editor
|
| 157 |
components[f"{editor_key}_save_status"] = save_status
|
| 158 |
+
|
| 159 |
+
return components
|
| 160 |
+
|
| 161 |
+
def create_dynamic_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
| 162 |
+
"""Create UI components for displaying generated outputs"""
|
| 163 |
+
components = {}
|
| 164 |
+
|
| 165 |
+
# Create text and markdown components for outputs
|
| 166 |
+
for output in prompt_config.outputs:
|
| 167 |
+
# Replace accordion with a simple heading
|
| 168 |
+
gr.Markdown(f"### {prompt_config.description}")
|
| 169 |
|
| 170 |
+
with gr.Row():
|
|
|
|
| 171 |
with gr.Column(scale=1):
|
| 172 |
+
# Text component with function name as key
|
| 173 |
+
components[f"{output}_text"] = gr.Textbox(
|
| 174 |
+
label="Text Output",
|
| 175 |
+
lines=10,
|
| 176 |
+
interactive=False,
|
| 177 |
+
visible=True
|
| 178 |
)
|
| 179 |
+
|
|
|
|
|
|
|
|
|
|
| 180 |
with gr.Column(scale=1):
|
| 181 |
+
# Markdown component with function name as key
|
| 182 |
+
components[f"{output}_markdown"] = gr.Markdown(
|
| 183 |
+
value="",
|
| 184 |
+
visible=True,
|
| 185 |
+
show_copy_button=True,
|
| 186 |
+
elem_classes=["scrollable-markdown"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
)
|
| 188 |
+
|
| 189 |
+
# We no longer need to store an accordion component
|
| 190 |
+
# Instead, create a group to maintain the same structure for visibility control
|
| 191 |
+
with gr.Group() as group:
|
| 192 |
+
pass
|
| 193 |
+
components[f"{output}_group"] = group
|
| 194 |
+
|
| 195 |
return components
|
| 196 |
|
| 197 |
def create_quotation_generator_section():
|
| 198 |
+
# Initialize all variables at the start
|
| 199 |
quotation_cost = None
|
| 200 |
page_recalc_btn = None
|
| 201 |
page_progress_update = None
|
| 202 |
+
page_upload_drive_btn = None
|
| 203 |
+
page_upload_notion_btn = None
|
| 204 |
+
page_notes_box = None
|
| 205 |
+
page_save_quotation_btn = None
|
| 206 |
+
project_name = None
|
| 207 |
+
|
| 208 |
with gr.Tab(label="Quotation Generator"):
|
| 209 |
with gr.Row():
|
| 210 |
with gr.Column(scale=2):
|
| 211 |
gr.Markdown("## ⚠️ Instructions #2")
|
| 212 |
for instruction in [
|
| 213 |
+
"1. **Edit System Prompt**: Navigate to the System Prompts tab to edit prompts.",
|
| 214 |
+
"2. **Generate Output**: Click generate once ready.",
|
| 215 |
"3. **Upload Final Documentation**: Give a project name and click upload to Google Drive or Notion",
|
| 216 |
"4. **Recalculate Cost**: Recalculate the cost if you want to change the mandays estimate"
|
| 217 |
]:
|
|
|
|
| 222 |
|
| 223 |
with gr.Row():
|
| 224 |
with gr.Column(scale=4):
|
| 225 |
+
# Organize steps and their outputs
|
| 226 |
+
step_outputs = {}
|
| 227 |
for prompt_key, prompt_config in PROMPTS.items():
|
|
|
|
| 228 |
if prompt_config.step == "Chatbot Prompt Editors":
|
| 229 |
continue
|
| 230 |
+
|
| 231 |
step = prompt_config.step
|
| 232 |
sub_step = prompt_config.sub_step
|
| 233 |
+
|
| 234 |
+
if step not in step_outputs:
|
| 235 |
+
step_outputs[step] = {}
|
| 236 |
+
|
| 237 |
+
if sub_step:
|
| 238 |
+
if sub_step not in step_outputs[step]:
|
| 239 |
+
step_outputs[step][sub_step] = []
|
| 240 |
+
step_outputs[step][sub_step].append(prompt_key)
|
| 241 |
+
else:
|
| 242 |
+
if "main" not in step_outputs[step]:
|
| 243 |
+
step_outputs[step]["main"] = []
|
| 244 |
+
step_outputs[step]["main"].append(prompt_key)
|
| 245 |
|
| 246 |
all_components = {}
|
| 247 |
step_buttons = {}
|
| 248 |
|
| 249 |
+
# Create main step accordions
|
| 250 |
+
for step_name, sub_steps in step_outputs.items():
|
| 251 |
+
with gr.Accordion(step_name, open=False) :
|
| 252 |
+
# Create button for this step
|
| 253 |
+
try:
|
| 254 |
+
if ' : ' in step_name:
|
| 255 |
+
button_label = step_name.split(' : ')[1]
|
| 256 |
+
else:
|
| 257 |
+
button_label = step_name
|
| 258 |
+
except Exception:
|
| 259 |
+
button_label = step_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
|
| 261 |
+
step_buttons[step_name] = gr.Button(f"✅ Generate {button_label}")
|
| 262 |
+
|
| 263 |
+
# Create components for outputs
|
| 264 |
+
for sub_step, prompt_keys in sub_steps.items():
|
| 265 |
for prompt_key in prompt_keys:
|
| 266 |
if prompt_key in PROMPTS:
|
| 267 |
+
# Create invisible container for output components
|
| 268 |
+
with gr.Group(visible=False) as output_group:
|
| 269 |
+
# Use create_dynamic_section_components to create the components
|
| 270 |
+
dynamic_components = create_dynamic_section_components(PROMPTS[prompt_key])
|
| 271 |
+
|
| 272 |
+
# Add the group to the components dictionary
|
| 273 |
+
dynamic_components[f"{prompt_key}_group"] = output_group
|
| 274 |
+
|
| 275 |
+
# Store all components
|
| 276 |
+
all_components[prompt_key] = dynamic_components
|
| 277 |
|
| 278 |
with gr.Column(scale=1):
|
| 279 |
with gr.Row():
|
|
|
|
| 287 |
with gr.Column(scale=1):
|
| 288 |
page_upload_drive_btn = gr.Button("📁 Upload to Google Drive")
|
| 289 |
page_upload_notion_btn = gr.Button("📝 Upload to Notion")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 290 |
|
| 291 |
+
# Add system prompts tab
|
| 292 |
+
with gr.Tab(label="System Prompts"):
|
| 293 |
+
gr.Markdown("## System Prompts")
|
| 294 |
+
gr.Markdown("Edit the system prompts below to customize the generation process.")
|
| 295 |
+
|
| 296 |
+
# Add all prompt editors here
|
| 297 |
+
for prompt_key, prompt_config in PROMPTS.items():
|
| 298 |
+
# Check if prompt_config has ui attribute and it's not None
|
| 299 |
+
if prompt_config.ui is not None:
|
| 300 |
+
editor_key = next((k for k in prompt_config.ui.keys() if k.endswith('_prompt_editor')), None)
|
| 301 |
+
if editor_key:
|
| 302 |
+
with gr.Accordion(f"{prompt_config.description}", open=False):
|
| 303 |
+
components = create_prompt_editor_components(prompt_config)
|
| 304 |
+
# Add editor components to all_components
|
| 305 |
+
if prompt_key in all_components:
|
| 306 |
+
all_components[prompt_key].update(components)
|
| 307 |
+
else:
|
| 308 |
+
all_components[prompt_key] = components
|
| 309 |
+
|
| 310 |
+
# Setup event handlers
|
| 311 |
+
setup_all_handlers(
|
| 312 |
+
step_buttons,
|
| 313 |
+
all_components,
|
| 314 |
+
page_progress_update,
|
| 315 |
+
quotation_cost,
|
| 316 |
+
page_upload_drive_btn,
|
| 317 |
+
page_upload_notion_btn,
|
| 318 |
+
page_recalc_btn,
|
| 319 |
+
project_name
|
| 320 |
+
)
|
| 321 |
|
| 322 |
+
return (all_components, step_buttons,
|
| 323 |
+
page_progress_update, page_upload_drive_btn, page_upload_notion_btn,
|
| 324 |
+
quotation_cost, page_recalc_btn, page_notes_box, page_save_quotation_btn, project_name)
|
| 325 |
|
| 326 |
def update_display_mode(mode: str, text_content: str) -> tuple:
|
| 327 |
return (
|
|
|
|
| 333 |
with open("page_main.css", "r") as file:
|
| 334 |
custom_css = file.read()
|
| 335 |
|
| 336 |
+
with gr.Blocks(title="Quotation Chatbot (with SOW)", css=custom_css) as page_interface:
|
| 337 |
+
gr.Markdown("# Quotation Chatbot with SOW")
|
| 338 |
|
| 339 |
all_components = {}
|
| 340 |
|
|
|
|
| 356 |
|
| 357 |
for prompt_key, prompt_config in chatbot_prompts.items():
|
| 358 |
with gr.Accordion(prompt_config.description, open=False):
|
| 359 |
+
components = create_prompt_editor_components(prompt_config)
|
| 360 |
chatbot_editors[prompt_key] = components
|
| 361 |
|
| 362 |
with gr.Row():
|
common_functions_v4.py
CHANGED
|
@@ -13,7 +13,7 @@ import os
|
|
| 13 |
from dotenv import load_dotenv
|
| 14 |
from langtrace_python_sdk import langtrace
|
| 15 |
from state import state
|
| 16 |
-
from
|
| 17 |
|
| 18 |
no_active_session = "**Current Session**:None"
|
| 19 |
|
|
@@ -23,11 +23,7 @@ if api_key is None:
|
|
| 23 |
raise ValueError("Environment variable 'LANGTRACE_API_KEY' is not set. Please set it in your .env file.")
|
| 24 |
langtrace.init(api_key=api_key)
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
def check_session_exists():
|
| 28 |
-
"""Check if a valid session exists"""
|
| 29 |
-
return state.quotation_project.session_id is not None
|
| 30 |
-
|
| 31 |
def get_db_connection():
|
| 32 |
"""Establishes and returns a new database connection."""
|
| 33 |
db_params = {
|
|
|
|
| 13 |
from dotenv import load_dotenv
|
| 14 |
from langtrace_python_sdk import langtrace
|
| 15 |
from state import state
|
| 16 |
+
from prompt_configs import *
|
| 17 |
|
| 18 |
no_active_session = "**Current Session**:None"
|
| 19 |
|
|
|
|
| 23 |
raise ValueError("Environment variable 'LANGTRACE_API_KEY' is not set. Please set it in your .env file.")
|
| 24 |
langtrace.init(api_key=api_key)
|
| 25 |
|
| 26 |
+
#TODO: Since now we are merging both page and engage , we have to pull the project type in order to load the correct project
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
def get_db_connection():
|
| 28 |
"""Establishes and returns a new database connection."""
|
| 29 |
db_params = {
|
engage_prompts_config.py
DELETED
|
@@ -1,1125 +0,0 @@
|
|
| 1 |
-
from dataclasses import dataclass
|
| 2 |
-
from enum import Enum
|
| 3 |
-
from typing import List, Dict, Any, Optional
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
class ModelType(Enum):
|
| 7 |
-
O1_MINI = "o1-mini"
|
| 8 |
-
O4_MINI = "gpt-4o-mini"
|
| 9 |
-
|
| 10 |
-
class UIComponentType(Enum):
|
| 11 |
-
TEXTBOX = "textbox"
|
| 12 |
-
MARKDOWN = "markdown"
|
| 13 |
-
DATAFRAME = "dataframe"
|
| 14 |
-
|
| 15 |
-
@dataclass
|
| 16 |
-
class UIConfig:
|
| 17 |
-
component_type: UIComponentType
|
| 18 |
-
label: str
|
| 19 |
-
default_value: Any = None
|
| 20 |
-
visible: Optional[bool] = True
|
| 21 |
-
interactive: Optional[bool] = True
|
| 22 |
-
lines: Optional[int] = None
|
| 23 |
-
description: str = ""
|
| 24 |
-
show_copy_button: Optional[bool] = False
|
| 25 |
-
elem_classes: Optional[List[str]] = None
|
| 26 |
-
|
| 27 |
-
@dataclass
|
| 28 |
-
class PromptConfig:
|
| 29 |
-
prompt: str
|
| 30 |
-
inputs: List[str]
|
| 31 |
-
outputs: List[str]
|
| 32 |
-
model: ModelType
|
| 33 |
-
description: str = ""
|
| 34 |
-
step: Optional[str] = None
|
| 35 |
-
sub_step: Optional[str] = None
|
| 36 |
-
ui: Dict[str, UIConfig] = None
|
| 37 |
-
|
| 38 |
-
#################################################################################################################################################
|
| 39 |
-
|
| 40 |
-
PROMPTS = {
|
| 41 |
-
"client_initial_question": PromptConfig(
|
| 42 |
-
prompt=
|
| 43 |
-
"""
|
| 44 |
-
# Client Information Gathering Questions
|
| 45 |
-
|
| 46 |
-
### Company Background and Industry
|
| 47 |
-
1. Can you provide some background about your company?
|
| 48 |
-
2. Which industry do you operate in, and what is your company's niche or specialization?
|
| 49 |
-
3. Who are your primary customers?
|
| 50 |
-
4. What are the main objectives you want to achieve?
|
| 51 |
-
5. What key features or functionalities do you need?
|
| 52 |
-
|
| 53 |
-
### Current Challenges
|
| 54 |
-
6. What are the biggest challenges your firm is currently facing?
|
| 55 |
-
7. Can you describe your current processes?
|
| 56 |
-
|
| 57 |
-
### Workflow and System Impact
|
| 58 |
-
8. How will this solution benefit your firm as a whole?
|
| 59 |
-
|
| 60 |
-
### Existing Workflow or System
|
| 61 |
-
9. Can you describe your current workflow or system?
|
| 62 |
-
|
| 63 |
-
### Pain Point Identification
|
| 64 |
-
10. Where is your current system falling short or causing delays?
|
| 65 |
-
11. Are there any parts of the process that are particularly time-consuming/ prone to error?
|
| 66 |
-
""",
|
| 67 |
-
inputs=[],
|
| 68 |
-
outputs=[],
|
| 69 |
-
model=ModelType.O1_MINI,
|
| 70 |
-
description="Initial Client Questions",
|
| 71 |
-
step="Chatbot Prompt Editors",
|
| 72 |
-
ui={
|
| 73 |
-
"client_initial_question_prompt_editor": UIConfig(
|
| 74 |
-
component_type=UIComponentType.TEXTBOX,
|
| 75 |
-
label="Initial Questions Prompt",
|
| 76 |
-
interactive=True,
|
| 77 |
-
lines=20
|
| 78 |
-
)
|
| 79 |
-
}
|
| 80 |
-
),
|
| 81 |
-
|
| 82 |
-
"generate_client_follow_up": PromptConfig(
|
| 83 |
-
prompt=
|
| 84 |
-
"""
|
| 85 |
-
Based on the initial list of questions and the client's provided answers, generate **insightful and targeted follow-up questions** that will help deepen my understanding of the following critical aspects:
|
| 86 |
-
|
| 87 |
-
1. **Client Overview**
|
| 88 |
-
**Objective:** ask relevant questions that will directly contribute to better project requirements gathering. (ie: department team that the project is meant for ..etc)
|
| 89 |
-
|
| 90 |
-
2. **Project Vision and Value**
|
| 91 |
-
**Objective:** Clarify the intended impact of the project on the client's business. Understand how it will improve their processes, solve key challenges, and deliver measurable benefits.
|
| 92 |
-
**Focus:** Investigate specific outcomes, immediate expected goals, and how success will be defined.
|
| 93 |
-
|
| 94 |
-
3. **Existing System or Workflow Description**
|
| 95 |
-
**Objective:** Delve deeper into the client's current tools, workflows, and processes to uncover pain points, integration requirements, and opportunities for optimization.
|
| 96 |
-
**Focus:** Identify inefficiencies, technical limitations, or gaps that the project will address.
|
| 97 |
-
|
| 98 |
-
4. **Budget and Resource Constraints**
|
| 99 |
-
**Objective:** Clearly define any limitations or constraints—financial, resource-based, or time-related—that could impact project success.
|
| 100 |
-
**Focus:** Understand the flexibility of the budget, timeline expectations, and resource availability.
|
| 101 |
-
|
| 102 |
-
Instructions:
|
| 103 |
-
Each question should:
|
| 104 |
-
Build on provided client information
|
| 105 |
-
Non repetitive, and unique. Avoid asking similar questions.
|
| 106 |
-
Include realistic sample answers relevant to the client's context
|
| 107 |
-
Focus on gathering quantifiable or specific information
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
Output top 10 questions in the following format:
|
| 111 |
-
<question>(sample answers)
|
| 112 |
-
Just return the text and NOTHING else. Do not overexplain, omit code guards.
|
| 113 |
-
""",
|
| 114 |
-
inputs=["project_detail"],
|
| 115 |
-
outputs=["follow_up_questions"],
|
| 116 |
-
model=ModelType.O1_MINI,
|
| 117 |
-
description="Generate follow-up questions with sample answers",
|
| 118 |
-
step="Chatbot Prompt Editors",
|
| 119 |
-
ui={
|
| 120 |
-
"client_follow_up_prompt_editor": UIConfig(
|
| 121 |
-
component_type=UIComponentType.TEXTBOX,
|
| 122 |
-
label="Client Follow-up Questions Prompt",
|
| 123 |
-
lines=20,
|
| 124 |
-
interactive=True,
|
| 125 |
-
)
|
| 126 |
-
}
|
| 127 |
-
),
|
| 128 |
-
|
| 129 |
-
"generate_follow_up_questions": PromptConfig(
|
| 130 |
-
prompt=
|
| 131 |
-
"""
|
| 132 |
-
You are a Chatbot Development Expert specializing in creating intelligent, user-friendly, and scalable AI chatbot solutions for startups. You will be provided with client background information.
|
| 133 |
-
|
| 134 |
-
Your task is identify gaps in chatbot project requirements and generate highly specific and actionable follow-up questions to clarify underlying needs. Leverage frameworks such as the 5 Whys and root cause analysis for deeper exploration.
|
| 135 |
-
Ensure questions are tailored, referencing prior context or statements for precision.
|
| 136 |
-
|
| 137 |
-
Requirements:
|
| 138 |
-
You need to FULLY read the input which is given below client background information.
|
| 139 |
-
Generate follow-up questions to identify missing details or ambiguities.
|
| 140 |
-
Use specific references to prior responses for continuity. For example: "You mentioned [context]. Can you elaborate on [specific aspect]?"
|
| 141 |
-
Apply the 5 Whys to delve deeper where necessary. For example: "Why do call centers become overloaded during month-end? Are there specific processes causing bottlenecks?"
|
| 142 |
-
Highlight systemic issues where patterns emerge (e.g., manual processes across multiple challenges).
|
| 143 |
-
|
| 144 |
-
# Output Format:
|
| 145 |
-
# <index><question>(sample answers)
|
| 146 |
-
|
| 147 |
-
Just return the generated list of follow up questions as string and nothing else.
|
| 148 |
-
""",
|
| 149 |
-
inputs=["project_detail"],
|
| 150 |
-
outputs=["generated_follow_up_questions"],
|
| 151 |
-
model=ModelType.O1_MINI,
|
| 152 |
-
description="Generate detailed follow up questions with sample answers",
|
| 153 |
-
step="Chatbot Prompt Editors",
|
| 154 |
-
ui={
|
| 155 |
-
"follow_up_prompt_editor": UIConfig(
|
| 156 |
-
component_type=UIComponentType.TEXTBOX,
|
| 157 |
-
label="Folow-up Questions Prompt",
|
| 158 |
-
lines=20,
|
| 159 |
-
interactive=True
|
| 160 |
-
)
|
| 161 |
-
}
|
| 162 |
-
),
|
| 163 |
-
|
| 164 |
-
"question_generator": PromptConfig(
|
| 165 |
-
prompt=
|
| 166 |
-
"""
|
| 167 |
-
You are a chatbot project manager responsible for gathering detailed requirements in order to generate an accurate and comprehensive quotation for a client's chatbot project.
|
| 168 |
-
Your task is to ask good follow up questions based on what you already know
|
| 169 |
-
Consider the following inputs:
|
| 170 |
-
|
| 171 |
-
1. **Requirements Rubric:** Use this as a baseline list of initial questions of the chatbot project
|
| 172 |
-
2. **Project Details:** Background information on the client, industry, and high-level project requirements.
|
| 173 |
-
|
| 174 |
-
### Instructions:
|
| 175 |
-
- Analyze the rubric and project details to generate clear, concise, succinct questions
|
| 176 |
-
- If the project requirement already includes an answer to a question in the rubric, do not generate that question.
|
| 177 |
-
- If the project requirement had not already include the answer to a question , then DO generate the question based on the requirements rubric following the section name and criteria.
|
| 178 |
-
- Ensure your generated questions are highly relevant and specific to the client's business context. Avoid general or vague questions; tailor each question to the client's specific operations.
|
| 179 |
-
- Include realistic sample answers relevant to the client's context
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
### Output Format:
|
| 183 |
-
Give your output as string in the following format:
|
| 184 |
-
<index><question>(sample answers)
|
| 185 |
-
|
| 186 |
-
Just return the string text and NOTHING else, omit code guards.
|
| 187 |
-
""",
|
| 188 |
-
inputs=["project_detail", "requirements_rubric"],
|
| 189 |
-
outputs=["generated_questions"],
|
| 190 |
-
model=ModelType.O1_MINI,
|
| 191 |
-
description="Generate detailed questions with sample answers",
|
| 192 |
-
step="Chatbot Prompt Editors",
|
| 193 |
-
ui={
|
| 194 |
-
"question_generator_prompt_editor": UIConfig(
|
| 195 |
-
component_type=UIComponentType.TEXTBOX,
|
| 196 |
-
label="Question Generator Prompt",
|
| 197 |
-
lines=20,
|
| 198 |
-
interactive=True,
|
| 199 |
-
)
|
| 200 |
-
}
|
| 201 |
-
),
|
| 202 |
-
|
| 203 |
-
"generate_prd": PromptConfig(
|
| 204 |
-
prompt=
|
| 205 |
-
"""
|
| 206 |
-
Rewrite this for clarity while keeping all specific details, metrics, and constraints.
|
| 207 |
-
Please take note of the time constraint to build the MVP.
|
| 208 |
-
Do not include context or assumptions beyond the input provided.
|
| 209 |
-
Do not also exclude any input provided.
|
| 210 |
-
Structure the document to ensure clarity and logical flow.
|
| 211 |
-
Make sure to make the title "Project Requirements".
|
| 212 |
-
""",
|
| 213 |
-
inputs=["project_detail"],
|
| 214 |
-
outputs=["generated_prd"],
|
| 215 |
-
model=ModelType.O1_MINI,
|
| 216 |
-
description="Step 1.1 : Generate Project Requirements Document (PRD)",
|
| 217 |
-
step="Step 1 : Scope & Components",
|
| 218 |
-
ui={
|
| 219 |
-
"requirement_prompt_editor": UIConfig(
|
| 220 |
-
component_type=UIComponentType.TEXTBOX,
|
| 221 |
-
label="Requirements(PRD) System Prompt",
|
| 222 |
-
lines=20,
|
| 223 |
-
interactive=True
|
| 224 |
-
),
|
| 225 |
-
"generated_prd_text": UIConfig(
|
| 226 |
-
component_type=UIComponentType.TEXTBOX,
|
| 227 |
-
label="Requirements(PRD) Output",
|
| 228 |
-
lines=20,
|
| 229 |
-
visible=True
|
| 230 |
-
),
|
| 231 |
-
"generated_prd_markdown": UIConfig(
|
| 232 |
-
component_type=UIComponentType.MARKDOWN,
|
| 233 |
-
label="Requirements(PRD) Output",
|
| 234 |
-
visible=True,
|
| 235 |
-
show_copy_button=True
|
| 236 |
-
)
|
| 237 |
-
}
|
| 238 |
-
),
|
| 239 |
-
|
| 240 |
-
"generate_intent_list": PromptConfig(
|
| 241 |
-
prompt=
|
| 242 |
-
"""
|
| 243 |
-
You are an solution architect and project manager with 20+ years of experience in building chatbots and AI-powered systems.
|
| 244 |
-
Your task is to analyze the provided project requirement document and help me understand the complexity of the project by defining ALL possible intents and workflows for each requirement.
|
| 245 |
-
Additionally, anticipate and suggest realistic, real-life intents that might have been overlooked by the client but are critical for a robust and user-friendly chatbot. You can reference **how other chatbots in the same industry are functioning** and suggest intents that are commonly provided by competitors but may not have been explicitly mentioned by the client. List down these suggestion in one seperate table.
|
| 246 |
-
|
| 247 |
-
Instruction:
|
| 248 |
-
1. **Break Down Requirements**: Identify all the client requirements from the document.
|
| 249 |
-
2. **Define ALL Possible Intents and Workflows**: For each requirement, list ALL possible intents and their corresponding workflows. - Use "→" to represent the flow between steps.
|
| 250 |
-
- Provide your analysis in a clear, highly readable and structured table format. The intents to consider are:
|
| 251 |
-
- Simple
|
| 252 |
-
- Complex
|
| 253 |
-
- Multi-Step
|
| 254 |
-
- Single-Step
|
| 255 |
-
- Fallback.Focus on business-centric fallback (e.g., "Order Management Fallback" should address specific order-related issues like invalid SKU, payment failure, or inventory unavailability)
|
| 256 |
-
- Others (if applicable)
|
| 257 |
-
|
| 258 |
-
Output Format:
|
| 259 |
-
Present the analysis in a tabular format with the following structure:
|
| 260 |
-
- Each requirement as the title of a separate table.
|
| 261 |
-
- **Columns**:
|
| 262 |
-
- Intent Type (e.g., Simple, Complex, Multi-Step, etc.)
|
| 263 |
-
- Intent (e.g., Order Status Inquiry, Track Order Progress, etc.)
|
| 264 |
-
- Workflow (describe the technical/logical steps using "→" and numbered steps, e.g., "1. Extract user input → 2. Query database → 3. Return result").
|
| 265 |
-
""",
|
| 266 |
-
inputs=["generated_prd"],
|
| 267 |
-
outputs=["generated_intent_list"],
|
| 268 |
-
model=ModelType.O1_MINI,
|
| 269 |
-
description="Step 1.2 : Generate Intent List",
|
| 270 |
-
step="Step 1 : Scope & Components",
|
| 271 |
-
ui={
|
| 272 |
-
"intent_list_prompt_editor": UIConfig(
|
| 273 |
-
component_type=UIComponentType.TEXTBOX,
|
| 274 |
-
label="Intent List System Prompt",
|
| 275 |
-
lines=20,
|
| 276 |
-
interactive=True
|
| 277 |
-
),
|
| 278 |
-
"generated_intent_list_text": UIConfig(
|
| 279 |
-
component_type=UIComponentType.TEXTBOX,
|
| 280 |
-
label="Intent List Output",
|
| 281 |
-
lines=20,
|
| 282 |
-
visible=True
|
| 283 |
-
),
|
| 284 |
-
"generated_intent_list_markdown": UIConfig(
|
| 285 |
-
component_type=UIComponentType.MARKDOWN,
|
| 286 |
-
label="Intent List Output",
|
| 287 |
-
visible=True,
|
| 288 |
-
show_copy_button=True
|
| 289 |
-
)
|
| 290 |
-
}
|
| 291 |
-
),
|
| 292 |
-
|
| 293 |
-
"generate_plan_test_components": PromptConfig(
|
| 294 |
-
prompt=
|
| 295 |
-
"""
|
| 296 |
-
You are an expert in chatbot project planning and testing. Your task is to create a highly detailed, actionable, and project-specific Component List for a chatbot project, focusing exclusively on the Planning and Testing phases. excluding Development phase. The response must align with the project's goals, technical stack, and compliance requirements, ensuring granularity, specificity, and adherence to the provided Project Requirement Document (PRD).
|
| 297 |
-
|
| 298 |
-
Instructions:
|
| 299 |
-
Break the project into the following phases:
|
| 300 |
-
1. Planning Phase ( Focus on: Project initiation ,Requirement gathering,Technical architecture design, Integration planning)
|
| 301 |
-
2. Testing Phase (Focus on: Integration testing
|
| 302 |
-
System testing
|
| 303 |
-
User Acceptance Testing (UAT) )
|
| 304 |
-
|
| 305 |
-
Components:
|
| 306 |
-
For each phase, include project-specific components that align with the goal of developing the chatbot Project. Break down each phase into granular sub-components and tasks, ensuring specificity and alignment with the PRD.
|
| 307 |
-
Use the PRD to extract relevant, granular components that reflect the tasks and deliverables unique to this project.
|
| 308 |
-
Ensure components are actionable and tied to the technical stack
|
| 309 |
-
|
| 310 |
-
Tech Stack:
|
| 311 |
-
Backend: FastAPI, Python
|
| 312 |
-
Chatbot: Chatbot Builder , COZE , Yellow.ai
|
| 313 |
-
Infrastructure: AWS, PostgreSQL, Redis, Docker, Alembic
|
| 314 |
-
|
| 315 |
-
Output Format:
|
| 316 |
-
Return the final tables and nothing else. Do not provide a summary at the end.
|
| 317 |
-
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 318 |
-
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
| 319 |
-
""",
|
| 320 |
-
inputs=["generated_prd"],
|
| 321 |
-
outputs=["generated_plan_test_components"],
|
| 322 |
-
model=ModelType.O1_MINI,
|
| 323 |
-
description="Step 1.3 : Generate planning and testing components",
|
| 324 |
-
step="Step 1 : Scope & Components",
|
| 325 |
-
ui={
|
| 326 |
-
"plan_test_prompt_editor": UIConfig(
|
| 327 |
-
component_type=UIComponentType.TEXTBOX,
|
| 328 |
-
label="Plan & Test Component Prompt",
|
| 329 |
-
lines=20,
|
| 330 |
-
interactive=True
|
| 331 |
-
),
|
| 332 |
-
"generated_plan_test_components_text": UIConfig(
|
| 333 |
-
component_type=UIComponentType.TEXTBOX,
|
| 334 |
-
label="Plan Test Components",
|
| 335 |
-
lines=20,
|
| 336 |
-
visible=True
|
| 337 |
-
),
|
| 338 |
-
"generated_plan_test_components_markdown": UIConfig(
|
| 339 |
-
component_type=UIComponentType.MARKDOWN,
|
| 340 |
-
label="Plan Test Components",
|
| 341 |
-
visible=True,
|
| 342 |
-
show_copy_button=True
|
| 343 |
-
)
|
| 344 |
-
}
|
| 345 |
-
),
|
| 346 |
-
|
| 347 |
-
"generate_dev_components": PromptConfig(
|
| 348 |
-
prompt=
|
| 349 |
-
"""
|
| 350 |
-
**Role**:
|
| 351 |
-
You are a technical project manager and software architect specializing in chatbot development.
|
| 352 |
-
Your task is to create a granular "Development Component List" by extracting components from the **Project Requirement Document (PRD)** and the **Chatbot Intent List (CIL)**.
|
| 353 |
-
The output should align with the **project's specific goals** and focus on **technical implementation**.
|
| 354 |
-
|
| 355 |
-
### **Objectives**:
|
| 356 |
-
1. **Complements the CIL**: Ensure the components directly support the intents and workflows defined in the CIL.
|
| 357 |
-
2. **Aligns with the PRD**: Incorporate project-specific goals, business logic, and technical requirements from the PRD.
|
| 358 |
-
3. **Focus on Technical Implementation**: Provide actionable development tasks and deliverables.
|
| 359 |
-
4. **Project-Specific**: Avoid generic components; extract details directly from the PRD and CIL.
|
| 360 |
-
5. **Granular and Readable**: Maintain a balance between granularity and readability for actionable outputs.
|
| 361 |
-
|
| 362 |
-
**Key Focus**:
|
| 363 |
-
- Translate the **intents, workflows, fallbacks, and unhappy paths** from the CIL into **specific development deliverables** or tasks.
|
| 364 |
-
- Ensure that the deliverables are **actionable** and **context-aware**, aligning with the project's technical stack and business requirements.
|
| 365 |
-
|
| 366 |
-
### **Inputs**:
|
| 367 |
-
1. **PRD**: Contains functional, non-functional, technical, and compliance requirements for the chatbot project.
|
| 368 |
-
2. **CIL**: Lists intents the chatbot will handle, including **fallbacks** and **unhappy paths** with their corresponding workflows.
|
| 369 |
-
|
| 370 |
-
---
|
| 371 |
-
|
| 372 |
-
### **Process**:
|
| 373 |
-
1. **Read and Analyze the PRD and CIL**:
|
| 374 |
-
- Carefully review the PRD to understand the **project's specific goals, business logic, and technical requirements**.
|
| 375 |
-
- Review the CIL to identify the intents, workflows, fallbacks, and unhappy paths the chatbot will handle.
|
| 376 |
-
|
| 377 |
-
2. **Extract Granular Components**:
|
| 378 |
-
- Identify *ALL components* in the PRD and the CIL.
|
| 379 |
-
- Components should directly reference functionalities or deliverables related to the project.
|
| 380 |
-
- Identify key business logic.
|
| 381 |
-
- Prioritize components that provide high business value, such as core functionality.
|
| 382 |
-
- Organize components into logical categories. Avoid Testing, Support and Maintenance, Documentation and Training components.
|
| 383 |
-
|
| 384 |
-
3. **Identify Unhappy Paths and Fallbacks**:
|
| 385 |
-
- For each intent including the suggested or additional intents, identify unhappy paths or fallbacks (e.g., errors, exceptions, or edge cases) provided in the CIL. Define **specific development deliverables** or tasks. Examples include:
|
| 386 |
-
- **Order Creation**: Implement SKU validation logic and inventory availability checks.
|
| 387 |
-
- **Payment Processing**: Integrate payment retry mechanisms and notify users of payment status.
|
| 388 |
-
- **Document Extraction**: Add field validation logic and manual upload options for failed extractions.
|
| 389 |
-
- **Input Validation**: Implement file size and type checks, and provide fallback instructions for unsupported inputs.
|
| 390 |
-
- Ensure that the deliverables are **actionable** and **context-aware**.
|
| 391 |
-
|
| 392 |
-
---
|
| 393 |
-
|
| 394 |
-
### **Tech Stack**:
|
| 395 |
-
- **Backend**: FastAPI, Python
|
| 396 |
-
- **Chatbot Tools**: Chatbot Builder , COZE , Yellow.ai
|
| 397 |
-
- **Infrastructure**: AWS, PostgreSQL, Redis, Docker, Alembic
|
| 398 |
-
|
| 399 |
-
---
|
| 400 |
-
|
| 401 |
-
### **Output**:
|
| 402 |
-
- Compile a list of components from the PRD and CIL.
|
| 403 |
-
- Use a clear, tabular format with **project-specific context** for each component:
|
| 404 |
-
- Avoid using "Handle" for the Subcomponent naming.
|
| 405 |
-
|
| 406 |
-
| **Component** | **Subcomponent** | **Deliverables** |
|
| 407 |
-
|---------------------|------------------------|--------------------------------|
|
| 408 |
-
| **<Component 1>** | **<Subcomponent 1>** | 1. <Deliverable 1> <br> 2. <Deliverable 2> <br> 3. <Deliverable 3> |
|
| 409 |
-
|
| 410 |
-
Return the final tables and nothing else. Do not provide a summary at the end.
|
| 411 |
-
""",
|
| 412 |
-
inputs=["generated_prd" , "generated_intent_list"],
|
| 413 |
-
outputs=["generated_dev_components"],
|
| 414 |
-
model=ModelType.O1_MINI,
|
| 415 |
-
description="Step 1.4 : Generate development components",
|
| 416 |
-
step="Step 1 : Scope & Components",
|
| 417 |
-
ui={
|
| 418 |
-
"dev_component_prompt_editor": UIConfig(
|
| 419 |
-
component_type=UIComponentType.TEXTBOX,
|
| 420 |
-
label="Development System Prompt",
|
| 421 |
-
lines=20,
|
| 422 |
-
interactive=True
|
| 423 |
-
),
|
| 424 |
-
"generated_dev_components_text": UIConfig(
|
| 425 |
-
component_type=UIComponentType.TEXTBOX,
|
| 426 |
-
label="Development Components Output",
|
| 427 |
-
lines=20,
|
| 428 |
-
visible=True
|
| 429 |
-
),
|
| 430 |
-
"generated_dev_components_markdown": UIConfig(
|
| 431 |
-
component_type=UIComponentType.MARKDOWN,
|
| 432 |
-
label="Developemnt Components Output",
|
| 433 |
-
visible=True,
|
| 434 |
-
show_copy_button=True
|
| 435 |
-
)
|
| 436 |
-
}
|
| 437 |
-
),
|
| 438 |
-
|
| 439 |
-
"reformat_dev_components": PromptConfig(
|
| 440 |
-
prompt=
|
| 441 |
-
"""
|
| 442 |
-
**Role**:
|
| 443 |
-
You are a technical project manager and software architect responsible for ensuring consistent naming conventions in chatbot development. Your task is to standardize the naming of common chatbot components and subcomponents while preserving all existing components and subcomponents, including unique, domain-specific components.
|
| 444 |
-
|
| 445 |
-
### **Process**:
|
| 446 |
-
1. **Analyze the Development Component List (DCL)**:
|
| 447 |
-
- Identify components and subcomponents that are common across chatbot projects (e.g., "Chatbot Engine" vs. "Chatbot Interface").
|
| 448 |
-
- Identify domain-specific components that should remain unchanged.
|
| 449 |
-
- Ensure that technical terminology and categorization are consistent across component , particularly for components of similar concepts to maintain uniformity.
|
| 450 |
-
|
| 451 |
-
2. **Standardize Common Chatbot Components**:
|
| 452 |
-
- Cross-check common components against a standardized reference list (see below).
|
| 453 |
-
- Rename only the common chatbot components to their standardized equivalent while keeping the intended meaning intact.
|
| 454 |
-
- Ensure all subcomponents are retained and placed under the correct standardized component.
|
| 455 |
-
|
| 456 |
-
3. **Preserve All Existing Components and Subcomponents**:
|
| 457 |
-
- Ensure that no components or subcomponents are removed during standardization
|
| 458 |
-
- If a component is highly specific to a particular use case, do not modify it
|
| 459 |
-
- Retain any unique features that are tailored to the project
|
| 460 |
-
- Verify that each component has appropriate subcomponents and deliverables
|
| 461 |
-
|
| 462 |
-
### **Standardized Naming Conventions (for Common Chatbot Components)**:
|
| 463 |
-
| **Standard Component** | **Common Subcomponents** |
|
| 464 |
-
|------------------------------|--------------------------------|
|
| 465 |
-
| Core Chatbot Engine | Intent Recognition, NER, Context Management, Dialog Flow, Response Generation, Multi-turn Handling |
|
| 466 |
-
| LLM Processing Pipeline | Text Preprocessing, Entity Extraction |
|
| 467 |
-
| Integration Layer | API Gateway, CRM/ERP Integration, Knowledge Base Integration, Third-party Services |
|
| 468 |
-
| Data Management | ETL Pipelines, Database Operations, Data Versioning, Cache Management |
|
| 469 |
-
| Security and Compliance | Authentication, Authorization, Data Encryption, Audit Logging, GDPR/PDPA Compliance |
|
| 470 |
-
| Infrastructure | AWS/Cloud Setup, Docker Containerization, CI/CD Pipeline, Environment Management |
|
| 471 |
-
| Error Handling | Error Logging, Exception Management, Fallback Responses, Escalation Workflows |
|
| 472 |
-
| User Management | User Authentication, Profile Management, Session Handling, Role-based Access |
|
| 473 |
-
| Monitoring & Analytics | Performance Metrics, Usage Analytics, Error Tracking, Real-time Dashboards |
|
| 474 |
-
| Feedback & Learning | User Feedback Collection, Model Performance Tracking, A/B Testing, Continuous Learning |
|
| 475 |
-
| Conversation Management | Context Retention, Topic Switching, Language Support, Flow Control |
|
| 476 |
-
| Channel Management | Web Integration, Mobile Support, Social Media Platforms |
|
| 477 |
-
| AI/ML Components | LLM Integration, RAG Implementation, Fine-tuning Pipeline, Vector Store Management |
|
| 478 |
-
| Business Logic Layer | Custom Rules Engine, Workflow Automation, Business Process Integration |
|
| 479 |
-
| Knowledge Management | Content Management, FAQ Updates, Knowledge Graph, Document Processing |
|
| 480 |
-
| Human Handoff | Agent Routing, Queue Management, Conversation History Transfer, Live Chat Support |
|
| 481 |
-
| Performance & Scaling | Load Balancing, Auto-scaling, Performance Optimization, Resource Management |
|
| 482 |
-
| Development Tools | Testing Framework, Debugging Tools, Development Environment, Documentation |
|
| 483 |
-
|
| 484 |
-
### **Output**:
|
| 485 |
-
- Return the Updated Component List in a clear, structured format.
|
| 486 |
-
- Maintain the tabular format while applying consistent naming conventions.
|
| 487 |
-
- Each component should be distinct and well-defined.
|
| 488 |
-
- No repeated components or overlapping functionality.
|
| 489 |
-
- Ensure that all components and subcomponents are included in the output.
|
| 490 |
-
- Provide only the corrected table and nothing else.
|
| 491 |
-
""",
|
| 492 |
-
inputs=["generated_dev_components"],
|
| 493 |
-
outputs=["reformatted_dev_components"],
|
| 494 |
-
model=ModelType.O1_MINI,
|
| 495 |
-
description="Step 1.5 : Reformat development components",
|
| 496 |
-
step="Step 1 : Scope & Components",
|
| 497 |
-
ui={
|
| 498 |
-
"reformatted_dev_components_prompt_editor": UIConfig(
|
| 499 |
-
component_type=UIComponentType.TEXTBOX,
|
| 500 |
-
label="Reformatted Development Components",
|
| 501 |
-
lines=20,
|
| 502 |
-
interactive=True
|
| 503 |
-
),
|
| 504 |
-
"reformatted_dev_components_text": UIConfig(
|
| 505 |
-
component_type=UIComponentType.TEXTBOX,
|
| 506 |
-
label="Reformatted Development Components Output",
|
| 507 |
-
lines=20,
|
| 508 |
-
visible=True
|
| 509 |
-
),
|
| 510 |
-
"reformatted_dev_components_markdown": UIConfig(
|
| 511 |
-
component_type=UIComponentType.MARKDOWN,
|
| 512 |
-
label="Reformatted Development Components Markdown Output",
|
| 513 |
-
visible=True,
|
| 514 |
-
show_copy_button=True
|
| 515 |
-
)
|
| 516 |
-
}
|
| 517 |
-
),
|
| 518 |
-
|
| 519 |
-
"generate_intents_csv": PromptConfig(
|
| 520 |
-
prompt=
|
| 521 |
-
"""
|
| 522 |
-
You will be provided with an intent list. Your task is to convert the entire list into a CSV string, ensuring that all rows from the list are included without omission. The CSV should contain the following columns: "intent_type", "intent", and "workflow". Follow these rules:
|
| 523 |
-
|
| 524 |
-
Enclose all text values, including the column headers, in double quotes ("").
|
| 525 |
-
Retain numeric values as-is, without any quotes.
|
| 526 |
-
Ensure the CSV string is formatted correctly, with commas separating the values and each row represented on a new line.
|
| 527 |
-
Your response must include every row and correctly reflect the structure and content of the intent list. Just return the CSV text and nothing else. Omit any code guards ```.
|
| 528 |
-
""",
|
| 529 |
-
inputs=["generated_intent_list"],
|
| 530 |
-
outputs=["generated_intents_csv"],
|
| 531 |
-
model=ModelType.O1_MINI,
|
| 532 |
-
description="Step 2.1 : Generate Intent CSV",
|
| 533 |
-
step="Step 2 : Mandays & Quotation",
|
| 534 |
-
sub_step="Step 2.1 : Generate Mandays",
|
| 535 |
-
ui={
|
| 536 |
-
"intents_csv_prompt_editor": UIConfig(
|
| 537 |
-
component_type=UIComponentType.TEXTBOX,
|
| 538 |
-
label="Intent CSV System Prompt",
|
| 539 |
-
lines=20,
|
| 540 |
-
interactive=True
|
| 541 |
-
),
|
| 542 |
-
"generated_intents_csv_dataframe": UIConfig(
|
| 543 |
-
component_type=UIComponentType.DATAFRAME,
|
| 544 |
-
label="Generated Intents CSV",
|
| 545 |
-
interactive=True,
|
| 546 |
-
visible=True
|
| 547 |
-
)
|
| 548 |
-
}
|
| 549 |
-
),
|
| 550 |
-
|
| 551 |
-
"generate_plan_test_mandays": PromptConfig(
|
| 552 |
-
prompt=
|
| 553 |
-
"""
|
| 554 |
-
You are an experienced project manager tasked to create a detailed task breakdown for a project based on the planning and testing component list and the development component list.
|
| 555 |
-
|
| 556 |
-
Objective:
|
| 557 |
-
Generate a structured output organized by component. Provide a table with the following columns:
|
| 558 |
-
- Component: The name of component, as defined in the component list. ()
|
| 559 |
-
- Manday: The estimated effort required for a one-person team to complete the task, based on real-world complexity and scope.
|
| 560 |
-
- Description: A detailed explanation of the task, including deliverables or outcomes, as defined in the component list.
|
| 561 |
-
|
| 562 |
-
Instruction:
|
| 563 |
-
1. Input:
|
| 564 |
-
- Use the planning and testing component list identify all components and subcomponents. The hierarchy of the document is Phase -> Component -> Subcomponent -> Task
|
| 565 |
-
|
| 566 |
-
2. Manday Estimation:
|
| 567 |
-
Assign a manday estimate for each component based on the complexity and effort required, ensuring it falls between 0.2 and 5 days.
|
| 568 |
-
Ensure estimates are based on real-world complexity and scope while accounting for potential delays or complications.
|
| 569 |
-
|
| 570 |
-
**Output Format**:
|
| 571 |
-
Create a CSV file with the following columns:
|
| 572 |
-
"component",,"subcomponent","mandays","description"
|
| 573 |
-
Just return the csv text and NOTHING else, omit the ``` code guards.
|
| 574 |
-
""",
|
| 575 |
-
inputs=["generated_plan_test_components"],
|
| 576 |
-
outputs=["generated_plan_test_mandays"],
|
| 577 |
-
model=ModelType.O1_MINI,
|
| 578 |
-
description="Step 2.1 : Generate Plan Test Mandays",
|
| 579 |
-
step="Step 2 : Mandays & Quotation",
|
| 580 |
-
sub_step="Step 2.1 : Generate Mandays",
|
| 581 |
-
ui={
|
| 582 |
-
"plan_test_mandays_prompt_editor": UIConfig(
|
| 583 |
-
component_type=UIComponentType.TEXTBOX,
|
| 584 |
-
label="Manday Estimator Prompt",
|
| 585 |
-
lines=20,
|
| 586 |
-
interactive=True
|
| 587 |
-
),
|
| 588 |
-
"generated_plan_test_mandays_dataframe": UIConfig(
|
| 589 |
-
component_type=UIComponentType.DATAFRAME,
|
| 590 |
-
label="Plan Test Mandays",
|
| 591 |
-
interactive=True,
|
| 592 |
-
visible=True
|
| 593 |
-
)
|
| 594 |
-
}
|
| 595 |
-
),
|
| 596 |
-
|
| 597 |
-
"generate_dev_mandays": PromptConfig(
|
| 598 |
-
prompt=
|
| 599 |
-
"""
|
| 600 |
-
You are an experienced project manager tasked to create a detailed task breakdown for a project based on the development component list.
|
| 601 |
-
|
| 602 |
-
Objective:
|
| 603 |
-
Generate a structured output organized by component. Provide a table with the following columns:
|
| 604 |
-
- Component: The name of component, as defined in the component list.
|
| 605 |
-
- Subcomponent: The subcategory or module within the component, as defined in the component list.
|
| 606 |
-
- Manday: The estimated effort required for a one-person team to complete the task, based on real-world complexity and scope.
|
| 607 |
-
- Description: A detailed explanation of the task, including deliverables or outcomes, as defined in the component list.
|
| 608 |
-
|
| 609 |
-
Instruction:
|
| 610 |
-
1. Input:
|
| 611 |
-
- Use the planning and testing component list and the development component list to identify all components, subcomponents, tasks and subtasks.
|
| 612 |
-
|
| 613 |
-
2. Manday Estimation:
|
| 614 |
-
For each subcomponent, estimate the manday based on the effort required for a single person to complete it,, ensuring it falls between 0.5 and 7 days.
|
| 615 |
-
- Ensure estimates are based on real-world complexity and scope while accounting for potential delays or complications.
|
| 616 |
-
|
| 617 |
-
**Output Format**:
|
| 618 |
-
Create a CSV file with the following columns:
|
| 619 |
-
"component","subcomponent","mandays","description"
|
| 620 |
-
Make sure you encapsulate all TEXT column in "", and keep numeric columns as is.
|
| 621 |
-
Just return the csv text and NOTHING else, omit the ``` code guards.
|
| 622 |
-
""",
|
| 623 |
-
inputs=["reformatted_dev_components"],
|
| 624 |
-
outputs=["generated_dev_mandays"],
|
| 625 |
-
model=ModelType.O1_MINI,
|
| 626 |
-
description="Step 2.1 : Generate Development Mandays",
|
| 627 |
-
step="Step 2 : Mandays & Quotation",
|
| 628 |
-
sub_step="Step 2.1 : Generate Mandays",
|
| 629 |
-
ui={
|
| 630 |
-
"dev_mandays_prompt_editor": UIConfig(
|
| 631 |
-
component_type=UIComponentType.TEXTBOX,
|
| 632 |
-
label="Dev Mandays System Prompt",
|
| 633 |
-
lines=20,
|
| 634 |
-
interactive=True
|
| 635 |
-
),
|
| 636 |
-
"generated_dev_mandays_dataframe": UIConfig(
|
| 637 |
-
component_type=UIComponentType.DATAFRAME,
|
| 638 |
-
label="Dev Mandays",
|
| 639 |
-
interactive=True,
|
| 640 |
-
visible=True
|
| 641 |
-
)
|
| 642 |
-
}
|
| 643 |
-
),
|
| 644 |
-
|
| 645 |
-
"generate_MVP_prd": PromptConfig(
|
| 646 |
-
prompt=
|
| 647 |
-
"""
|
| 648 |
-
Generate a comprehensive and structured Project Requirement Document (PRD) for a Minimum Viable Product (MVP) using the following inputs:
|
| 649 |
-
1. **General PRD Guidelines**: Use the provided general PRD as a framework for structure, tone, and level of detail. This includes sections like Introduction, Scope, Functional Requirements, Non-Functional Requirements, Technical Architecture, Workflow, Testing, Deployment, and Appendices.
|
| 650 |
-
2. **MVP Components**: Incorporate the specific MVP components & intents, including their descriptions, mandays estimates, and functionalities, into the relevant sections of the PRD. Ensure all details are accurately reflected.
|
| 651 |
-
|
| 652 |
-
Follow these instructions:
|
| 653 |
-
- Retain ALL specific details, metrics, and constraints from both the general PRD and MVP components.
|
| 654 |
-
- Pay special attention to the time constraint for building the MVP, as outlined in the inputs.
|
| 655 |
-
- Do not add any context or assumptions beyond the provided inputs.
|
| 656 |
-
- Do not exclude any details from the inputs.
|
| 657 |
-
- Structure the document to ensure clarity, logical flow, and readability and structure tabular format if necessary.
|
| 658 |
-
- Use the title "Project Requirements" for the document.
|
| 659 |
-
|
| 660 |
-
The output should be a well-organized PRD that combines the general PRD guidelines with the specific MVP components, ensuring alignment with the project's goals and constraints.
|
| 661 |
-
""",
|
| 662 |
-
inputs=["generated_prd" , "mvp_components"],
|
| 663 |
-
outputs=["generated_mvp_prd"],
|
| 664 |
-
model=ModelType.O1_MINI,
|
| 665 |
-
description="Step 3.1 : Generate MVP PRD",
|
| 666 |
-
step="Step 3 : Final Documentation",
|
| 667 |
-
ui={
|
| 668 |
-
"mvp_prd_prompt_editor": UIConfig(
|
| 669 |
-
component_type=UIComponentType.TEXTBOX,
|
| 670 |
-
label="MVP PRD System Prompt",
|
| 671 |
-
lines=20,
|
| 672 |
-
interactive=True
|
| 673 |
-
),
|
| 674 |
-
"generated_mvp_prd_text": UIConfig(
|
| 675 |
-
component_type=UIComponentType.TEXTBOX,
|
| 676 |
-
label="MVP PRD Output",
|
| 677 |
-
lines=20,
|
| 678 |
-
visible=True
|
| 679 |
-
),
|
| 680 |
-
"generated_mvp_prd_markdown": UIConfig(
|
| 681 |
-
component_type=UIComponentType.MARKDOWN,
|
| 682 |
-
label="MVP PRD Output",
|
| 683 |
-
visible=True,
|
| 684 |
-
show_copy_button=True
|
| 685 |
-
)
|
| 686 |
-
}
|
| 687 |
-
),
|
| 688 |
-
|
| 689 |
-
"generate_BD_SOW": PromptConfig(
|
| 690 |
-
prompt=
|
| 691 |
-
"""
|
| 692 |
-
As an project manager with 20+ years of experience, you are tasked to create a detailed Scope of Work (SOW) document. Analyze the provided project component list and scope document to generate the following sections. Follow the guidelines below to ensure a professional, structured, and client-ready output:
|
| 693 |
-
|
| 694 |
-
### **Scope of Work (SOW)**
|
| 695 |
-
|
| 696 |
-
#### **1. Project Background**
|
| 697 |
-
- Provide a brief overview of the project, including the context, problem statement, and why the project is being initiated.
|
| 698 |
-
- Break down key challenges (in bullet point) the company currently facing, quantifying the impacts where possible (e.g., lost revenue, downtime).
|
| 699 |
-
- Close this section with industry trends or other relevant background information, emphasizing risks of inaction leading to the project, in 2-3 sentences.
|
| 700 |
-
|
| 701 |
-
#### **2. Project Objective**
|
| 702 |
-
- Clearly define the project's primary goals and what constitutes success, using the following structure:
|
| 703 |
-
- Goals: List specific, measurable goals (e.g., reduce processing time by 20%).
|
| 704 |
-
- Outcomes: Describe tangible deliverables and metrics for success.
|
| 705 |
-
|
| 706 |
-
#### **3. Project Buyers & Stakeholders**
|
| 707 |
-
- List key stakeholders involved in the project, e.g. buyers, end-users, and decision-makers.
|
| 708 |
-
- Identify their name and roles in the project, using a table.
|
| 709 |
-
|
| 710 |
-
#### **4. System Flow**
|
| 711 |
-
- Provide description of how the system components interact, describing what each module does and how it works.
|
| 712 |
-
- Use one of the following:
|
| 713 |
-
- Visual Representation: Diagram illustrating workflows or data flows between modules.
|
| 714 |
-
- Textual Description: Detailed explanation of the processes and transitions
|
| 715 |
-
- Use bullet point, ensure simplicity and avoid overly technical language.
|
| 716 |
-
|
| 717 |
-
#### **5. Modules and Functional Requirements Breakdown**
|
| 718 |
-
- LEAVE THIS BLANK
|
| 719 |
-
|
| 720 |
-
#### **6. Acceptance Criteria**
|
| 721 |
-
- Define conditions to be met, including specific, measurable criteria for project completion:
|
| 722 |
-
- Link each deliverable/module to its validation or testing process (e.g., UAT).
|
| 723 |
-
- Table format with the following column:
|
| 724 |
-
- Deliverable (e.g. Field Matching Automation module)
|
| 725 |
-
- Criteria, starting with "able to" (e.g. able to extract, match, and change the case status accordingly)
|
| 726 |
-
|
| 727 |
-
#### **7. Assumptions and Pre-requisites**
|
| 728 |
-
- List all planning-phase assumptions and pre-requisites, grouped into:
|
| 729 |
-
- Assumptions: Detailed, scenario-based assumptions that the project relies on. Each assumption should:
|
| 730 |
-
- Reference specific stakeholders (e.g., PWT staff, Mindhive).
|
| 731 |
-
- Describe specific conditions or expectations (e.g., document quality, workflow stability).
|
| 732 |
-
- Be written in clear, concise language.
|
| 733 |
-
- Pre-requisites or dependencies: Conditions that must be met before the project can proceed. Each pre-requisite should:
|
| 734 |
-
- Be specific and actionable.
|
| 735 |
-
- Reference who is responsible and what needs to be done.
|
| 736 |
-
|
| 737 |
-
#### **8. Proposed Timeline**
|
| 738 |
-
- Provide a project timeline, including:
|
| 739 |
-
- Milestone
|
| 740 |
-
- Expected Date/Duration
|
| 741 |
-
- Outcome/Deliverable
|
| 742 |
-
- Use a Gantt chart or table to visualize the timeline.
|
| 743 |
-
- Ensure the output are clean, organized, and easy to read.
|
| 744 |
-
|
| 745 |
-
#### **9. Commercial**
|
| 746 |
-
Summarize the project's commercial details in the following subsections:
|
| 747 |
-
- Development Fee: Create a table summarizing the costs for development, including the product, technical work supporting, or other additional services provided
|
| 748 |
-
- Subscription Fee: If applicable, create a table summarizing subscription fees for system usage.
|
| 749 |
-
- Payment Terms: Include a text description of payment terms:
|
| 750 |
-
- Milestones: Specify at which stages payments are due
|
| 751 |
-
- Invoicing: Define invoicing intervals (e.g., monthly, quarterly) and payment deadlines
|
| 752 |
-
- Other Terms: Mention late payment fees or additional terms, if applicable
|
| 753 |
-
- Output Format for tables: {Service}, {Fee} (leave amount blank)
|
| 754 |
-
|
| 755 |
-
#### **10. Sign-Off**
|
| 756 |
-
- Create a professional and formal Sign-Off section to acknowledge and approve the SOW.
|
| 757 |
-
- Include an statement to clearly communicate that both parties have reviewed and agreed to the SOW.
|
| 758 |
-
- Provide placeholder for each party (Company):
|
| 759 |
-
- Signature
|
| 760 |
-
- Name
|
| 761 |
-
- Position
|
| 762 |
-
- Date
|
| 763 |
-
|
| 764 |
-
#### **Guidelines**
|
| 765 |
-
- Use bullet points for clarity.
|
| 766 |
-
- Keep descriptions concise and client-friendly; avoid technical jargon unless necessary.
|
| 767 |
-
- Maintain structured sections and tables for readability.
|
| 768 |
-
|
| 769 |
-
Expected output should be professional, well-structured, and designed to help clients and stakeholders clearly understand the project scope. I'm going to tip you for a better outcome!
|
| 770 |
-
""",
|
| 771 |
-
inputs=[
|
| 772 |
-
"generated_prd",
|
| 773 |
-
"generated_plan_test_components",
|
| 774 |
-
"reformatted_dev_components",
|
| 775 |
-
"generated_intent_list",
|
| 776 |
-
"quotation_cost"
|
| 777 |
-
],
|
| 778 |
-
outputs=["generated_BD_SOW"],
|
| 779 |
-
model=ModelType.O1_MINI,
|
| 780 |
-
description="Step 3.2 : Generate Business Development SOW",
|
| 781 |
-
step="Step 3 : Final Documentation",
|
| 782 |
-
ui={
|
| 783 |
-
"BD_SOW_prompt_editor": UIConfig(
|
| 784 |
-
component_type=UIComponentType.TEXTBOX,
|
| 785 |
-
label="BD SOW Generator Prompt",
|
| 786 |
-
lines=20,
|
| 787 |
-
interactive=True
|
| 788 |
-
),
|
| 789 |
-
"generated_BD_SOW_text": UIConfig(
|
| 790 |
-
component_type=UIComponentType.TEXTBOX,
|
| 791 |
-
label="BD SOW",
|
| 792 |
-
lines=20,
|
| 793 |
-
visible=True
|
| 794 |
-
),
|
| 795 |
-
"generated_BD_SOW_markdown": UIConfig(
|
| 796 |
-
component_type=UIComponentType.MARKDOWN,
|
| 797 |
-
label="BD SOW",
|
| 798 |
-
visible=True,
|
| 799 |
-
show_copy_button=True
|
| 800 |
-
)
|
| 801 |
-
}
|
| 802 |
-
),
|
| 803 |
-
|
| 804 |
-
"generate_Tech_SOW": PromptConfig(
|
| 805 |
-
prompt=
|
| 806 |
-
"""
|
| 807 |
-
As an experienced project manager with over 20 years of expertise, you are tasked to create a detailed Scope of Work (SOW) document in JSON format. The JSON output should contain markdown-formatted strings as values for each section of the SOW. Analyze the provided project component list and scope document to generate the following sections:
|
| 808 |
-
|
| 809 |
-
### **Scope of Work (SOW)**
|
| 810 |
-
|
| 811 |
-
#### **1. Scope Summary**
|
| 812 |
-
- Provide a concise, high-level overview of the project scope. Divide it into three subsections:
|
| 813 |
-
- In Scope:
|
| 814 |
-
- List all deliverables, functionalities, and modules included in the project.
|
| 815 |
-
- Be specific about what will be developed, implemented, or delivered.
|
| 816 |
-
- Include MVP components (e.g., basic features, functionality, UI, document processing).
|
| 817 |
-
- Assumptions:
|
| 818 |
-
- Highlight key project-specific assumptions that the project relies on.
|
| 819 |
-
- Dependencies:
|
| 820 |
-
- List all internal and external dependencies required for the project's success.
|
| 821 |
-
- Include any third-party integrations, resources, or timelines that the project depends on.
|
| 822 |
-
|
| 823 |
-
#### **2. Modules and Functional Requirements Breakdown**
|
| 824 |
-
- Break down the project into modules or components.
|
| 825 |
-
- Prsent the details in a succinct and client-friendly table with the following column:
|
| 826 |
-
- Module
|
| 827 |
-
ii. Functionalities/Features
|
| 828 |
-
iii. Notes for any special considerations or constraints (e.g., 'Supports files up to 100MB').
|
| 829 |
-
- Use clear, concise, non-technical language. (e.g., 'Drag-and-drop support for PDFs, Excel, CSV; progress indicators'). Avoid excessive detail.
|
| 830 |
-
- Include MVP components as part of the breakdown and provide clear functionalities related to those (e.g., basic document upload, UI features, data processing).
|
| 831 |
-
|
| 832 |
-
#### **3. Out of Scope**
|
| 833 |
-
- Explicitly define what is excluded from the project's scope. This may include any functionalities, tasks, or deliverables.
|
| 834 |
-
- Ensure clarity to prevent future misunderstandings.
|
| 835 |
-
|
| 836 |
-
#### **4. System Flow**
|
| 837 |
-
- Provide a detailed, step-by-step description of how the system components interact.
|
| 838 |
-
- For each component or module:
|
| 839 |
-
- Describe what it does and how it works, including both success and unsuccessful scenarios
|
| 840 |
-
- Explain how it interacts with other components
|
| 841 |
-
- Include MVP-related components in the system flow, describing their function and interaction within the MVP's framework.
|
| 842 |
-
|
| 843 |
-
Output Requirements:
|
| 844 |
-
Just return the json object and nothing else, omit code guards ```, where each key represents a section of the SOW, and the value is a markdown-formatted string for that section.
|
| 845 |
-
Use clear, concise, and client-friendly language. Avoid excessive technical jargon unless necessary.
|
| 846 |
-
Example JSON Output:
|
| 847 |
-
{
|
| 848 |
-
"scope_summary": <markdown content>,
|
| 849 |
-
"modules_and_functional_requirements": <markdown content>,
|
| 850 |
-
"out_of_scope": <markdown content>,
|
| 851 |
-
"system_flow": <markdown content>
|
| 852 |
-
}
|
| 853 |
-
""",
|
| 854 |
-
inputs=["generated_plan_test_components","reformatted_dev_components","generated_intent_list","mvp_components"],
|
| 855 |
-
outputs=["generated_Tech_SOW"],
|
| 856 |
-
model=ModelType.O1_MINI,
|
| 857 |
-
description="Step 3.3 : Generate Technical SOW",
|
| 858 |
-
step="Step 3 : Final Documentation",
|
| 859 |
-
ui={
|
| 860 |
-
"Tech_SOW_prompt_editor": UIConfig(
|
| 861 |
-
component_type=UIComponentType.TEXTBOX,
|
| 862 |
-
label="Technical SOW Generator Prompt",
|
| 863 |
-
lines=20,
|
| 864 |
-
interactive=True
|
| 865 |
-
),
|
| 866 |
-
"generated_Tech_SOW_text": UIConfig(
|
| 867 |
-
component_type=UIComponentType.TEXTBOX,
|
| 868 |
-
label="Technical SOW",
|
| 869 |
-
lines=20,
|
| 870 |
-
visible=True
|
| 871 |
-
),
|
| 872 |
-
"generated_Tech_SOW_markdown": UIConfig(
|
| 873 |
-
component_type=UIComponentType.MARKDOWN,
|
| 874 |
-
label="Technical SOW",
|
| 875 |
-
visible=True,
|
| 876 |
-
show_copy_button=True
|
| 877 |
-
)
|
| 878 |
-
}
|
| 879 |
-
),
|
| 880 |
-
|
| 881 |
-
"analyze_planning_testing_mandays": PromptConfig(
|
| 882 |
-
prompt=
|
| 883 |
-
"""
|
| 884 |
-
You are an experienced project manager tasked with analyzing the provided planning and testing mandays estimates. Your goal is to identify the highest priority components that must be completed to build the MVP. Focus on components that deliver **immediate value to users** and are **critical for the core functionality** of the product.
|
| 885 |
-
|
| 886 |
-
Objective:
|
| 887 |
-
Identify the highest priority planning and testing components that are critical for the MVP's core functionality and deliver immediate value to the business. Exclude all non-critical components that do not directly contribute to the MVP's primary functionality.
|
| 888 |
-
|
| 889 |
-
Key Guidelines:
|
| 890 |
-
- Focus on Core Functionality: Only include components that are essential for the MVP to function and deliver immediate value to users.
|
| 891 |
-
- Exclude Non-Critical Components: Do not include components related to advanced security, compliance, scalability, authentication, fallback mechanisms, or any feature that is not absolutely necessary for the MVP.
|
| 892 |
-
- Prioritize Business Value: Ensure the selected components align with the business's core objectives and deliver measurable value.
|
| 893 |
-
- Minimalistic Approach: Focus on the least effort required to deliver the most value.
|
| 894 |
-
|
| 895 |
-
Output Format Requirements:
|
| 896 |
-
- Provide a clear list of identified priority planning/testing components with a brief justification for each selection.
|
| 897 |
-
- Ensure the output is concise and actionable.
|
| 898 |
-
""",
|
| 899 |
-
inputs=["generated_plan_test_mandays"],
|
| 900 |
-
outputs=["identified_planning_testing_components"],
|
| 901 |
-
model=ModelType.O1_MINI,
|
| 902 |
-
description="Step 2.2 : MVP Plan_Test Analysis",
|
| 903 |
-
step='Step 2 : Mandays & Quotation',
|
| 904 |
-
sub_step="Step 2.2 : Analyze Components",
|
| 905 |
-
ui={
|
| 906 |
-
"mvp_planning_testing_prompt_editor": UIConfig(
|
| 907 |
-
component_type=UIComponentType.TEXTBOX,
|
| 908 |
-
label="MVP Plan_Test Analysis Prompt",
|
| 909 |
-
lines=20,
|
| 910 |
-
interactive=True
|
| 911 |
-
)
|
| 912 |
-
}
|
| 913 |
-
),
|
| 914 |
-
|
| 915 |
-
"analyze_development_mandays": PromptConfig(
|
| 916 |
-
prompt=
|
| 917 |
-
"""
|
| 918 |
-
You are an experienced project manager tasked with analyzing the provided development mandays estimates. Your goal is to assign a priority level to each development component based on its importance to the MVP's core functionality and business value. Focus exclusively on components that deliver immediate value to users and are critical for the core functionality of the product.
|
| 919 |
-
|
| 920 |
-
Key Guidelines:
|
| 921 |
-
- **Focus on Core Functionality:** Assign priority levels based on how essential each component is for the MVP to function and deliver immediate value to users.
|
| 922 |
-
- **Exclude Non-Critical Considerations:** Do not label components related to advanced security, compliance, scalability, authentication, fallback mechanisms, or any feature that is **NOT** absolutely necessary for the MVP as "high" priority.
|
| 923 |
-
- **Prioritize Business Value:** Ensure the priority levels align with the business's core objectives and deliver measurable value.
|
| 924 |
-
- **Minimalistic Approach:** Focus on the least effort required to deliver the most value when assigning priority levels.
|
| 925 |
-
- **Assign Priority Levels:** Label each development component as "high," "medium," or "low" priority based on its importance to the MVP's core functionality and business value.
|
| 926 |
-
|
| 927 |
-
Objective:
|
| 928 |
-
Assign a priority level ("high," "medium," or "low") to each development component, ensuring the output reflects the importance of each component to the MVP's core functionality and business value. Retain all original components in the list.
|
| 929 |
-
|
| 930 |
-
Output Format Requirements:
|
| 931 |
-
- Provide a list of all development components with their assigned priority levels.
|
| 932 |
-
- Include a "Priority" column labeling each component as "high," "medium," or "low."
|
| 933 |
-
- Ensure the output is concise and actionable.
|
| 934 |
-
|
| 935 |
-
Important Notes:
|
| 936 |
-
- If a component is not directly tied to the core functionality or can be deferred to a later phase, assign it a lower priority ("medium" or "low").
|
| 937 |
-
- Do not exclude any components from the list, even if they are low priority.
|
| 938 |
-
- Only assign "high" priority to components that are absolutely necessary for the MVP to function.
|
| 939 |
-
""",
|
| 940 |
-
inputs=["generated_dev_mandays"],
|
| 941 |
-
outputs=["identified_development_components"],
|
| 942 |
-
model=ModelType.O1_MINI,
|
| 943 |
-
description="Step 2.2 : MVP Development Analysis",
|
| 944 |
-
step="Step 2 : Mandays & Quotation",
|
| 945 |
-
sub_step="Step 2.2 : Analyze Components",
|
| 946 |
-
ui={
|
| 947 |
-
"mvp_development_prompt_editor": UIConfig(
|
| 948 |
-
component_type=UIComponentType.TEXTBOX,
|
| 949 |
-
label="MVP Development Analysis Prompt",
|
| 950 |
-
lines=20,
|
| 951 |
-
interactive=True
|
| 952 |
-
)
|
| 953 |
-
}
|
| 954 |
-
),
|
| 955 |
-
|
| 956 |
-
"analyze_mvp_intents": PromptConfig(
|
| 957 |
-
prompt=
|
| 958 |
-
"""
|
| 959 |
-
You are an experienced project manager tasked with analyzing the provided intents mandays estimates. Your goal is to assign a priority level to each intents based on its importance to the MVP's core functionality and business value. Focus exclusively on intents that deliver immediate value to users and are critical for the core functionality of the product.
|
| 960 |
-
|
| 961 |
-
Key Guidelines:
|
| 962 |
-
- **Focus on Core Functionality:** Assign priority levels based on how essential each intents is for the MVP to function and deliver immediate value to users.
|
| 963 |
-
- **Exclude Non-Critical Considerations:** Do not label intents related to advanced security, compliance, scalability, authentication, fallback mechanisms, or any feature that is **NOT** absolutely necessary for the MVP as "high" priority.
|
| 964 |
-
- **Prioritize Business Value:** Ensure the priority levels align with the business's core objectives and deliver measurable value.
|
| 965 |
-
- **Minimalistic Approach:** Focus on the least effort required to deliver the most value when assigning priority levels.
|
| 966 |
-
- **Assign Priority Levels:** Label each development intents as "high," "medium," or "low" priority based on its importance to the MVP's core functionality and business value.
|
| 967 |
-
|
| 968 |
-
Objective:
|
| 969 |
-
Assign a priority level ("high," "medium," or "low") to each development intents , ensuring the output reflects the importance to the MVP's core functionality and business value. Retain all original components in the list.
|
| 970 |
-
|
| 971 |
-
Important Notes:
|
| 972 |
-
- If a component is not directly tied to the core functionality or can be deferred to a later phase, assign it a lower priority ("medium" or "low").
|
| 973 |
-
- Do not exclude any intents rom the list, even if they are low priority.
|
| 974 |
-
- Only assign "high" priority to intents that are absolutely necessary for the MVP to function.
|
| 975 |
-
|
| 976 |
-
Output Format Requirements:
|
| 977 |
-
Convert the entire list into a CSV string, ensuring that all rows from the list are included without omission. The CSV should contain the following columns: "intent_type", "intent", and "workflow". Follow these rules:
|
| 978 |
-
|
| 979 |
-
Enclose all text values, including the column headers, in double quotes ("").
|
| 980 |
-
Retain numeric values as-is, without any quotes.
|
| 981 |
-
Ensure the CSV string is formatted correctly, with commas separating the values and each row represented on a new line.
|
| 982 |
-
Your response must include every row and correctly reflect the structure and content of the intent list. Just return the CSV text and nothing else. Omit any code guards ```.
|
| 983 |
-
""",
|
| 984 |
-
inputs=["generated_intent_list"],
|
| 985 |
-
outputs=["identified_mvp_intents"],
|
| 986 |
-
model=ModelType.O1_MINI,
|
| 987 |
-
description="Step 2.2 : MVP Intent Analysis",
|
| 988 |
-
step='Step 2 : Mandays & Quotation',
|
| 989 |
-
sub_step="Step 2.2 : Analyze Components",
|
| 990 |
-
ui={
|
| 991 |
-
"mvp_intents_prompt_editor": UIConfig(
|
| 992 |
-
component_type=UIComponentType.TEXTBOX,
|
| 993 |
-
label="MVP Intent Analysis Prompt",
|
| 994 |
-
lines=20,
|
| 995 |
-
interactive=True
|
| 996 |
-
)
|
| 997 |
-
}
|
| 998 |
-
),
|
| 999 |
-
|
| 1000 |
-
"recalculate_mandays": PromptConfig(
|
| 1001 |
-
prompt=
|
| 1002 |
-
"""
|
| 1003 |
-
Based on the identified priority components and the identified priority intent list from the previous analysis , your task is to recalculate the mandays estimates to ensure they fit within the time given (e.g., days or weeks) in building the MVP mentioned in the Project Requirement Document (PRD).
|
| 1004 |
-
|
| 1005 |
-
Objective:
|
| 1006 |
-
Read the entire PRD and identify the time constraint ; Recalculate the manday estimates for both development components and intents to ensure the total combined mandays fit within the MVP timeline specified in the Project Requirement Document (PRD). Adjust mandays while maintaining feasibility and ensuring core functionality delivery. Retain all components and intents in the list, even if their mandays are set to 0.
|
| 1007 |
-
|
| 1008 |
-
Key Guidelines:
|
| 1009 |
-
1. Total Combined Mandays Constraint:
|
| 1010 |
-
The combined total mandays for development components and intents must not exceed MVP timeline.
|
| 1011 |
-
Ensure the total is calculated as:
|
| 1012 |
-
Total Combined Mandays = Development Components Mandays + Intents Mandays ≤ MVP timeline.
|
| 1013 |
-
Convert Time Estimates:
|
| 1014 |
-
Convert all time estimates into raw mandays:
|
| 1015 |
-
- 1 week = 7 mandays
|
| 1016 |
-
- 1 month = 28-31 mandays
|
| 1017 |
-
- If input is in days, use as is.
|
| 1018 |
-
- If input is a range (e.g., 1-2 weeks), use the average (1.5 weeks = 7.5 mandays).
|
| 1019 |
-
2. Preserve All Components and Intents:
|
| 1020 |
-
3. Do not remove any components or intents from the list, even if their mandays are set to 0.
|
| 1021 |
-
4. Retain all planning and testing components but set their mandays to 0.
|
| 1022 |
-
5. Adjust Mandays Based on Priority:
|
| 1023 |
-
- For high priority, allocate the majority of mandays to ensure critical functionalities are minimally viable. Significant reductions may be necessary for non-core features (e.g., authentication, security).
|
| 1024 |
-
- For medium priority, allocate minimal mandays or set them to 0, as these can be deferred without impacting core functionalities.
|
| 1025 |
-
- For low priority, set mandays to 0, as these are not essential for the MVP.
|
| 1026 |
-
6. Iterative Adjustment:
|
| 1027 |
-
- If the total combined mandays still exceed the MVP timeline after the first adjustment, further reduce mandays for both high and medium priority components and intents until the total fits within the timeline.
|
| 1028 |
-
- Set mandays to 0 for non-essential components and intents if necessary, but do not remove them from the list.
|
| 1029 |
-
7. Strict Calculation for Intents:
|
| 1030 |
-
Properly calculate the total mandays for development components and MVP intents. Ensure the total combined mandays for both development components and MVP intents DO NOT exceed the MVP timeline.
|
| 1031 |
-
8. Justify Adjustments:
|
| 1032 |
-
- Provide a brief explanation for any adjustments made to the mandays, ensuring they align with the timeline and maintain the MVP's core functionality.
|
| 1033 |
-
|
| 1034 |
-
Output Format Requirements:
|
| 1035 |
-
- Provide a revised list of development components and intents with updated mandays estimates.
|
| 1036 |
-
- Include the "Priority" column for reference.
|
| 1037 |
-
- Include the total mandays for the revised plan and confirm whether it fits within the MVP timeline.
|
| 1038 |
-
- Retain all components and intents in the list, even if their mandays are set to 0.
|
| 1039 |
-
- Ensure the output is concise and actionable.
|
| 1040 |
-
|
| 1041 |
-
Important Notes:
|
| 1042 |
-
- If the total mandays still exceed the timeline after adjustments, prioritize further reductions in medium priority components and intents while keeping high priority components as intact as possible.
|
| 1043 |
-
- Do not remove any components or intents from the list, even if their mandays are reduced to 0.
|
| 1044 |
-
""",
|
| 1045 |
-
inputs=["identified_priority_components", "identified_mvp_intents" , "generated_prd"],
|
| 1046 |
-
outputs=["revised_mandays_estimates"],
|
| 1047 |
-
model=ModelType.O1_MINI,
|
| 1048 |
-
description="Step 2.3 : MVP Mandays Recalculation Prompt",
|
| 1049 |
-
step="Step 2 : Mandays & Quotation",
|
| 1050 |
-
sub_step="Step 2.3 : Recalculate Mandays",
|
| 1051 |
-
ui={
|
| 1052 |
-
"mandays_recalculation_prompt_editor": UIConfig(
|
| 1053 |
-
component_type=UIComponentType.TEXTBOX,
|
| 1054 |
-
label="MVP Mandays Recalculation Prompt",
|
| 1055 |
-
lines=20,
|
| 1056 |
-
interactive=True
|
| 1057 |
-
)
|
| 1058 |
-
}
|
| 1059 |
-
),
|
| 1060 |
-
|
| 1061 |
-
"generate_MVP_mandays": PromptConfig(
|
| 1062 |
-
prompt=
|
| 1063 |
-
"""
|
| 1064 |
-
Using the revised mandays estimates from the previous step, format the output into three clearly separated CSV sections: one for Planning/Testing Components, one for Development Components, and another for MVP Intents.
|
| 1065 |
-
|
| 1066 |
-
Objective:
|
| 1067 |
-
Structure the output to clearly delineate the three sections while maintaining the original column structure.
|
| 1068 |
-
|
| 1069 |
-
Output Format Requirements:
|
| 1070 |
-
- First Section - Planning & Testing Components:
|
| 1071 |
-
component,mandays,description
|
| 1072 |
-
"Requirements Analysis",0,"Critical user requirements and system specifications"
|
| 1073 |
-
|
| 1074 |
-
- Second Section - Development Components:
|
| 1075 |
-
component,subcomponent,mandays,description
|
| 1076 |
-
"Backend","Core API Development",3,"Essential API endpoints for basic functionality"
|
| 1077 |
-
|
| 1078 |
-
- Third Section - MVP Intents:
|
| 1079 |
-
intent_type,intent,workflow,mandays
|
| 1080 |
-
"Single-Step","Create New Order","1. User initiates order creation → 2. Extract order details from user input → 3. Save order to database → 4. Confirm creation to user",0.3
|
| 1081 |
-
|
| 1082 |
-
Important:
|
| 1083 |
-
- Each section must maintain its original column structure.
|
| 1084 |
-
- Sections MUST be separated by the marker: "---SECTION BREAK---".
|
| 1085 |
-
- Include ALL the components and intents.
|
| 1086 |
-
- No empty rows or missing values.
|
| 1087 |
-
- Text values must be in double quotes.
|
| 1088 |
-
- Numbers must not be in quotes.
|
| 1089 |
-
|
| 1090 |
-
Return only the CSV content with the section break, no additional text or explanations.
|
| 1091 |
-
""",
|
| 1092 |
-
inputs=["revised_mandays_estimates"],
|
| 1093 |
-
outputs=["generated_MVP_mandays"],
|
| 1094 |
-
model=ModelType.O1_MINI,
|
| 1095 |
-
description="Step 2.3 : Generate MVP Mandays",
|
| 1096 |
-
step="Step 2 : Mandays & Quotation",
|
| 1097 |
-
sub_step="Step 2.3 : Recalculate Mandays",
|
| 1098 |
-
ui={
|
| 1099 |
-
"generated_MVP_mandays_prompt_editor": UIConfig(
|
| 1100 |
-
component_type=UIComponentType.TEXTBOX,
|
| 1101 |
-
label="MVP Mandays Formatting System Prompt",
|
| 1102 |
-
lines=20,
|
| 1103 |
-
interactive=True
|
| 1104 |
-
),
|
| 1105 |
-
"mvp_plan_test_dataframe": UIConfig(
|
| 1106 |
-
component_type=UIComponentType.DATAFRAME,
|
| 1107 |
-
label="MVP Planning & Testing Components",
|
| 1108 |
-
interactive=True,
|
| 1109 |
-
visible=True
|
| 1110 |
-
),
|
| 1111 |
-
"mvp_dev_dataframe": UIConfig(
|
| 1112 |
-
component_type=UIComponentType.DATAFRAME,
|
| 1113 |
-
label="MVP Development Components",
|
| 1114 |
-
interactive=True,
|
| 1115 |
-
visible=True
|
| 1116 |
-
),
|
| 1117 |
-
"mvp_intents_dataframe": UIConfig(
|
| 1118 |
-
component_type=UIComponentType.DATAFRAME,
|
| 1119 |
-
label="MVP Intents",
|
| 1120 |
-
interactive=True,
|
| 1121 |
-
visible=True
|
| 1122 |
-
)
|
| 1123 |
-
}
|
| 1124 |
-
),
|
| 1125 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
event_handler.py
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from Project import *
|
| 2 |
+
from google_drive import *
|
| 3 |
+
from notion import upload_to_notion
|
| 4 |
+
from state import state
|
| 5 |
+
import gradio as gr
|
| 6 |
+
import json
|
| 7 |
+
from prompt_configs import PROMPTS
|
| 8 |
+
import pandas as pd
|
| 9 |
+
from io import StringIO
|
| 10 |
+
|
| 11 |
+
def make_components_visible(progress_update):
|
| 12 |
+
"""Make components visible before generating content"""
|
| 13 |
+
try:
|
| 14 |
+
# Create a list of updates to make components visible
|
| 15 |
+
updates = [progress_update.update(value="Starting generation...")]
|
| 16 |
+
|
| 17 |
+
# Make all components visible first
|
| 18 |
+
for function_name, function_components in components.items():
|
| 19 |
+
if isinstance(function_components, dict):
|
| 20 |
+
group = function_components.get(f"{function_name}_group")
|
| 21 |
+
text_output = function_components.get(f"{function_name}_text")
|
| 22 |
+
markdown_output = function_components.get(f"{function_name}_markdown")
|
| 23 |
+
|
| 24 |
+
if all([group, text_output, markdown_output]):
|
| 25 |
+
updates.extend([
|
| 26 |
+
group.update(visible=True),
|
| 27 |
+
text_output.update(visible=True, value="Generating..."),
|
| 28 |
+
markdown_output.update(visible=True, value="Generating...")
|
| 29 |
+
])
|
| 30 |
+
|
| 31 |
+
return updates
|
| 32 |
+
except Exception as e:
|
| 33 |
+
print(f"Error in make_components_visible: {str(e)}")
|
| 34 |
+
return [progress_update.update(value=f"Error: {str(e)}")]
|
| 35 |
+
|
| 36 |
+
def handle_prd_generation(progress_update):
|
| 37 |
+
"""Handle PRD and component generation"""
|
| 38 |
+
try:
|
| 39 |
+
# Create a list to collect all components that need to be updated
|
| 40 |
+
output_components = []
|
| 41 |
+
|
| 42 |
+
# Get the results from the project one by one
|
| 43 |
+
for function_name, result in state.quotation_project.generate_prd_and_components():
|
| 44 |
+
print(f"Received result for {function_name}")
|
| 45 |
+
|
| 46 |
+
# Get the corresponding components using the function name
|
| 47 |
+
function_components = components.get(function_name, {})
|
| 48 |
+
if function_components:
|
| 49 |
+
# Get all components - note the change from accordion to group
|
| 50 |
+
group = function_components.get(f"{function_name}_group")
|
| 51 |
+
text_output = function_components.get(f"{function_name}_text")
|
| 52 |
+
markdown_output = function_components.get(f"{function_name}_markdown")
|
| 53 |
+
|
| 54 |
+
if all([group, text_output, markdown_output]):
|
| 55 |
+
# Add components to the output list - no more accordion
|
| 56 |
+
output_components.extend([
|
| 57 |
+
group,
|
| 58 |
+
text_output,
|
| 59 |
+
markdown_output
|
| 60 |
+
])
|
| 61 |
+
|
| 62 |
+
# Update the components with content
|
| 63 |
+
text_output.update(value=result)
|
| 64 |
+
markdown_output.update(value=result)
|
| 65 |
+
|
| 66 |
+
# Update progress
|
| 67 |
+
progress_update.update(value=f"Generated output for {function_name}")
|
| 68 |
+
print(f"Updated components for {function_name}")
|
| 69 |
+
|
| 70 |
+
# Return all components that were updated plus the progress update
|
| 71 |
+
print(f"Returning {len(output_components)} components")
|
| 72 |
+
return [progress_update] + output_components
|
| 73 |
+
|
| 74 |
+
except Exception as e:
|
| 75 |
+
print(f"Error in handle_prd_generation: {str(e)}")
|
| 76 |
+
# Return updates to hide all components on error
|
| 77 |
+
return [progress_update.update(value=f"Error: {str(e)}")] + [gr.update(visible=False) for _ in range(len(components)*3)]
|
| 78 |
+
|
| 79 |
+
def setup_all_handlers(step_buttons, all_components, progress_update, quotation_cost, upload_drive_btn, upload_notion_btn, recalc_btn, project_name):
|
| 80 |
+
"""Set up all step handlers with the provided UI components"""
|
| 81 |
+
|
| 82 |
+
# Store components for use in handlers
|
| 83 |
+
global components
|
| 84 |
+
components = all_components
|
| 85 |
+
|
| 86 |
+
# Get all possible output components for the handler
|
| 87 |
+
output_components = []
|
| 88 |
+
for function_name, function_components in components.items():
|
| 89 |
+
if isinstance(function_components, dict):
|
| 90 |
+
group = function_components.get(f"{function_name}_group")
|
| 91 |
+
text = function_components.get(f"{function_name}_text")
|
| 92 |
+
markdown = function_components.get(f"{function_name}_markdown")
|
| 93 |
+
if all([group, text, markdown]):
|
| 94 |
+
output_components.extend([group, text, markdown])
|
| 95 |
+
|
| 96 |
+
# Set up handlers for each step button
|
| 97 |
+
for step_name, button in step_buttons.items():
|
| 98 |
+
if "Step 1" in step_name:
|
| 99 |
+
button.click(
|
| 100 |
+
fn=make_components_visible,
|
| 101 |
+
inputs=[progress_update],
|
| 102 |
+
outputs=[progress_update] + output_components
|
| 103 |
+
).then(
|
| 104 |
+
fn=handle_prd_generation,
|
| 105 |
+
inputs=[progress_update],
|
| 106 |
+
outputs=[progress_update] + output_components
|
| 107 |
+
)
|
event_handlers.py
DELETED
|
@@ -1,133 +0,0 @@
|
|
| 1 |
-
from Project import *
|
| 2 |
-
from google_drive import *
|
| 3 |
-
from notion import upload_to_notion
|
| 4 |
-
from page_prompts_config import *
|
| 5 |
-
|
| 6 |
-
def setup_all_handlers(step_buttons, all_components, page_progress_update, quotation_cost, page_recalc_btn, page_upload_drive_btn, page_upload_notion_btn, project_name):
|
| 7 |
-
"""Set up all step handlers with the provided UI components"""
|
| 8 |
-
|
| 9 |
-
# Step 1 handler remains unchanged
|
| 10 |
-
step_buttons['Step 1 : Scope & Components'].click(
|
| 11 |
-
fn=state.quotation_project.generate_prd_and_components,
|
| 12 |
-
inputs=[],
|
| 13 |
-
outputs=[
|
| 14 |
-
all_components['generate_prd']['generated_prd_text'],
|
| 15 |
-
all_components['generate_prd']['generated_prd_markdown'],
|
| 16 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 17 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_markdown'],
|
| 18 |
-
all_components['generate_dev_components']['generated_dev_components_text'],
|
| 19 |
-
all_components['generate_dev_components']['generated_dev_components_markdown'],
|
| 20 |
-
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 21 |
-
all_components['reformat_dev_components']['reformatted_dev_components_markdown'],
|
| 22 |
-
page_progress_update
|
| 23 |
-
],
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
# Step 2.1: Generate initial mandays
|
| 27 |
-
step_buttons['Step 2.1 : Generate Mandays'].click(
|
| 28 |
-
fn=state.quotation_project.generate_mandays,
|
| 29 |
-
inputs=[
|
| 30 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 31 |
-
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 32 |
-
],
|
| 33 |
-
outputs=[
|
| 34 |
-
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 35 |
-
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 36 |
-
page_progress_update
|
| 37 |
-
],
|
| 38 |
-
)
|
| 39 |
-
|
| 40 |
-
# Step 2.2: Analyze components
|
| 41 |
-
step_buttons['Step 2.2 : Analyze Components'].click(
|
| 42 |
-
fn=state.quotation_project.analyze_components,
|
| 43 |
-
inputs=[],
|
| 44 |
-
outputs=[
|
| 45 |
-
page_progress_update
|
| 46 |
-
],
|
| 47 |
-
)
|
| 48 |
-
|
| 49 |
-
# Step 2.3: Generate MVP estimates
|
| 50 |
-
step_buttons['Step 2.3 : Recalculate MVP Mandays'].click(
|
| 51 |
-
fn=state.quotation_project.generate_mvp_estimates,
|
| 52 |
-
inputs=[],
|
| 53 |
-
outputs=[
|
| 54 |
-
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 55 |
-
page_progress_update,
|
| 56 |
-
quotation_cost
|
| 57 |
-
],
|
| 58 |
-
)
|
| 59 |
-
|
| 60 |
-
# Step 3 handler remains unchanged
|
| 61 |
-
step_buttons['Step 3 : Final Documentation'].click(
|
| 62 |
-
fn=state.quotation_project.generate_sow,
|
| 63 |
-
inputs=[
|
| 64 |
-
all_components['generate_prd']['generated_prd_text'],
|
| 65 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 66 |
-
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 67 |
-
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 68 |
-
quotation_cost
|
| 69 |
-
],
|
| 70 |
-
outputs=[
|
| 71 |
-
all_components['generate_mvp_prd']['generated_mvp_prd_text'],
|
| 72 |
-
all_components['generate_mvp_prd']['generated_mvp_prd_markdown'],
|
| 73 |
-
all_components['generate_BD_SOW']['generated_BD_SOW_text'],
|
| 74 |
-
all_components['generate_BD_SOW']['generated_BD_SOW_markdown'],
|
| 75 |
-
all_components['generate_Tech_SOW']['generated_Tech_SOW_text'],
|
| 76 |
-
all_components['generate_Tech_SOW']['generated_Tech_SOW_markdown'],
|
| 77 |
-
page_progress_update
|
| 78 |
-
],
|
| 79 |
-
)
|
| 80 |
-
|
| 81 |
-
# Recalculate button handler
|
| 82 |
-
page_recalc_btn.click(
|
| 83 |
-
fn=state.quotation_project.recalculate_cost,
|
| 84 |
-
inputs=[
|
| 85 |
-
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 86 |
-
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 87 |
-
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 88 |
-
],
|
| 89 |
-
outputs=[
|
| 90 |
-
quotation_cost,
|
| 91 |
-
page_progress_update
|
| 92 |
-
]
|
| 93 |
-
)
|
| 94 |
-
|
| 95 |
-
# Upload to Google Drive handler
|
| 96 |
-
page_upload_drive_btn.click(
|
| 97 |
-
fn=upload_to_gdrive,
|
| 98 |
-
inputs=[
|
| 99 |
-
project_name,
|
| 100 |
-
all_components['generate_prd']['generated_prd_text'],
|
| 101 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 102 |
-
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 103 |
-
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 104 |
-
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 105 |
-
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 106 |
-
all_components['generate_mvp_prd']['generated_mvp_prd_text'],
|
| 107 |
-
quotation_cost,
|
| 108 |
-
all_components['generate_BD_SOW']['generated_BD_SOW_text'],
|
| 109 |
-
all_components['generate_Tech_SOW']['generated_Tech_SOW_text'],
|
| 110 |
-
],
|
| 111 |
-
outputs=[page_progress_update]
|
| 112 |
-
)
|
| 113 |
-
|
| 114 |
-
# Upload to Notion handler
|
| 115 |
-
page_upload_notion_btn.click(
|
| 116 |
-
fn=upload_to_notion,
|
| 117 |
-
inputs=[
|
| 118 |
-
project_name,
|
| 119 |
-
all_components['generate_prd']['generated_prd_text'],
|
| 120 |
-
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 121 |
-
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 122 |
-
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 123 |
-
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 124 |
-
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 125 |
-
all_components['generate_mvp_prd']['generated_mvp_prd_text'],
|
| 126 |
-
quotation_cost,
|
| 127 |
-
all_components['generate_BD_SOW']['generated_BD_SOW_text'],
|
| 128 |
-
all_components['generate_Tech_SOW']['generated_Tech_SOW_text'],
|
| 129 |
-
],
|
| 130 |
-
outputs=[page_progress_update]
|
| 131 |
-
)
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
page_prompts_config.py
DELETED
|
@@ -1,938 +0,0 @@
|
|
| 1 |
-
from dataclasses import dataclass
|
| 2 |
-
from enum import Enum
|
| 3 |
-
from typing import List, Dict, Any, Optional
|
| 4 |
-
|
| 5 |
-
class ModelType(Enum):
|
| 6 |
-
O1_MINI = "o1-mini"
|
| 7 |
-
O4_MINI = "gpt-4o-mini"
|
| 8 |
-
|
| 9 |
-
class UIComponentType(Enum):
|
| 10 |
-
TEXTBOX = "textbox"
|
| 11 |
-
MARKDOWN = "markdown"
|
| 12 |
-
DATAFRAME = "dataframe"
|
| 13 |
-
BUTTON = "button"
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
@dataclass
|
| 17 |
-
class UIConfig:
|
| 18 |
-
component_type: UIComponentType
|
| 19 |
-
label: str
|
| 20 |
-
default_value: Any = None
|
| 21 |
-
visible: bool = True
|
| 22 |
-
interactive: bool = True
|
| 23 |
-
lines: Optional[int] = None
|
| 24 |
-
description: str = ""
|
| 25 |
-
show_copy_button: bool = False
|
| 26 |
-
elem_classes: Optional[List[str]] = None
|
| 27 |
-
|
| 28 |
-
@dataclass
|
| 29 |
-
class PromptConfig:
|
| 30 |
-
prompt: str
|
| 31 |
-
inputs: List[str]
|
| 32 |
-
outputs: List[str]
|
| 33 |
-
model: ModelType
|
| 34 |
-
description: str = ""
|
| 35 |
-
step: str = ""
|
| 36 |
-
sub_step: str = ""
|
| 37 |
-
ui: Dict[str, UIConfig] = None
|
| 38 |
-
|
| 39 |
-
PROMPTS = {
|
| 40 |
-
"client_initial_question": PromptConfig(
|
| 41 |
-
prompt=
|
| 42 |
-
"""
|
| 43 |
-
# Client Information Gathering Questions
|
| 44 |
-
|
| 45 |
-
### Company Background and Industry
|
| 46 |
-
1. Can you provide some background about your company?
|
| 47 |
-
2. Which industry do you operate in, and what is your company's niche or specialization?
|
| 48 |
-
3. Who are your primary customers?
|
| 49 |
-
4. What are the main objectives you want to achieve?
|
| 50 |
-
5. What key features or functionalities do you need?
|
| 51 |
-
|
| 52 |
-
### Current Challenges
|
| 53 |
-
6. What are the biggest challenges your firm is currently facing?
|
| 54 |
-
7. Can you describe your current processes?
|
| 55 |
-
|
| 56 |
-
### Workflow and System Impact
|
| 57 |
-
8. How will this solution benefit your firm as a whole?
|
| 58 |
-
|
| 59 |
-
### Existing Workflow or System
|
| 60 |
-
9. Can you describe your current workflow or system?
|
| 61 |
-
|
| 62 |
-
### Pain Point Identification
|
| 63 |
-
10. Where is your current system falling short or causing delays?
|
| 64 |
-
11. Are there any parts of the process that are particularly time-consuming/ prone to error?
|
| 65 |
-
""",
|
| 66 |
-
inputs=[],
|
| 67 |
-
outputs=[],
|
| 68 |
-
model=ModelType.O1_MINI,
|
| 69 |
-
description="Client Initial Question",
|
| 70 |
-
step="Chatbot Prompt Editors",
|
| 71 |
-
ui={
|
| 72 |
-
"client_initial_question_prompt_editor": UIConfig(
|
| 73 |
-
component_type=UIComponentType.TEXTBOX,
|
| 74 |
-
label="Client Initial Questions",
|
| 75 |
-
interactive=True,
|
| 76 |
-
lines=20
|
| 77 |
-
)
|
| 78 |
-
}
|
| 79 |
-
),
|
| 80 |
-
|
| 81 |
-
"generate_client_follow_up": PromptConfig(
|
| 82 |
-
prompt=
|
| 83 |
-
"""
|
| 84 |
-
Based on the initial list of questions and the client's provided answers, generate **insightful and targeted follow-up questions** that will help deepen my understanding of the following critical aspects:
|
| 85 |
-
|
| 86 |
-
1. **Client Overview**
|
| 87 |
-
**Objective:** ask relevant questions that will directly contribute to better project requirements gathering. (ie: department team that the project is meant for ..etc)
|
| 88 |
-
|
| 89 |
-
2. **Project Vision and Value**
|
| 90 |
-
**Objective:** Clarify the intended impact of the project on the client's business. Understand how it will improve their processes, solve key challenges, and deliver measurable benefits.
|
| 91 |
-
**Focus:** Investigate specific outcomes, immediate expected goals, and how success will be defined.
|
| 92 |
-
|
| 93 |
-
3. **Existing System or Workflow Description**
|
| 94 |
-
**Objective:** Delve deeper into the client's current tools, workflows, and processes to uncover pain points, integration requirements, and opportunities for optimization.
|
| 95 |
-
**Focus:** Identify inefficiencies, technical limitations, or gaps that the project will address.
|
| 96 |
-
|
| 97 |
-
4. **Budget and Resource Constraints**
|
| 98 |
-
**Objective:** Clearly define any limitations or constraints—financial, resource-based, or time-related—that could impact project success.
|
| 99 |
-
**Focus:** Understand the flexibility of the budget, timeline expectations, and resource availability.
|
| 100 |
-
|
| 101 |
-
Instructions:
|
| 102 |
-
Each question should:
|
| 103 |
-
Build on provided client information
|
| 104 |
-
Non repetitive, and unique. Avoid asking similar questions.
|
| 105 |
-
Include realistic sample answers relevant to the client's context
|
| 106 |
-
Focus on gathering quantifiable or specific information
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
Output top 10 questions in the following format:
|
| 110 |
-
<question>(sample answers)
|
| 111 |
-
Just return the text and NOTHING else. Do not overexplain, omit code guards.
|
| 112 |
-
""",
|
| 113 |
-
inputs=['project_detail'],
|
| 114 |
-
outputs=['client_follow_up_questions'],
|
| 115 |
-
model=ModelType.O1_MINI,
|
| 116 |
-
description="Generate Client Follow-up Questions",
|
| 117 |
-
step="Chatbot Prompt Editors",
|
| 118 |
-
ui={
|
| 119 |
-
"client_follow_up_quetions_prompt_editor": UIConfig(
|
| 120 |
-
component_type=UIComponentType.TEXTBOX,
|
| 121 |
-
label="Client Follow-up Questions",
|
| 122 |
-
interactive=True,
|
| 123 |
-
lines=20
|
| 124 |
-
)
|
| 125 |
-
}
|
| 126 |
-
),
|
| 127 |
-
|
| 128 |
-
"gather_project_input": PromptConfig(
|
| 129 |
-
prompt=
|
| 130 |
-
"""
|
| 131 |
-
**You are a Software Development Expert specializing in scalable, secure, and robust document processing systems.
|
| 132 |
-
You will be provided with client background information.
|
| 133 |
-
Your task is to create a dynamic, context-aware list of questions to collaboratively gather client requirements for a document processing application.
|
| 134 |
-
Use the list below as a baseline. Generate additional, relevant questions on top of this baseline where appropriate.
|
| 135 |
-
Use the client's context to add clarity or relevance to the question.
|
| 136 |
-
Each question should provide actionable insights to uncover critical details about client needs and Sample Answers as guidance to the client to answer the questions.
|
| 137 |
-
### Areas to Cover:
|
| 138 |
-
---
|
| 139 |
-
Document Types:
|
| 140 |
-
<client context>, What specific types of documents will the application need to process (e.g., invoices, legal contracts, ID forms)?
|
| 141 |
-
<client context>, Are there specific complexities or variations in these documents that we should account for (e.g., multi-page documents, handwritten content)?
|
| 142 |
-
Inputs and Outputs:
|
| 143 |
-
<client context>, What are the expected input formats (e.g., PDFs, images, scanned documents)?
|
| 144 |
-
<client context>, What should the processed outputs look like (e.g., structured data, summaries, reports)?
|
| 145 |
-
<client context>, Are there any specific formatting requirements for outputs?
|
| 146 |
-
Document Quality:
|
| 147 |
-
<client context>, Are the documents typically clean and structured, or will the application need preprocessing capabilities (e.g., OCR, noise reduction)?
|
| 148 |
-
<client context>, Do you foresee any challenges with document quality, such as low resolution or inconsistent formatting?
|
| 149 |
-
Workflow Mapping:
|
| 150 |
-
<client context>, Can you describe your current document processing workflow?
|
| 151 |
-
<client context>, What are the major pain points or inefficiencies in the current process?
|
| 152 |
-
<client context>, Which parts of the workflow involve manual interventions, and how would you like to streamline them?
|
| 153 |
-
Integration Points:
|
| 154 |
-
<client context>, What existing systems or third-party tools does the application need to integrate with (e.g., CRMs, ERPs, cloud storage, OCR tools)?
|
| 155 |
-
<client context>, Are there specific APIs, databases, or platforms already in use that we need to consider?
|
| 156 |
-
Security and Compliance:
|
| 157 |
-
<client context>, What security measures are required to protect the data processed by the application?
|
| 158 |
-
<client context>, Are there any industry-specific compliance standards the application must adhere to (e.g., GDPR, HIPAA)?
|
| 159 |
-
Scalability and Performance:
|
| 160 |
-
<client context>, What is the expected volume of documents the application should handle on a daily/weekly/monthly basis?
|
| 161 |
-
<client context>, Are there performance benchmarks or response time requirements that the application must meet?
|
| 162 |
-
User Management and Access Control:
|
| 163 |
-
<client context>, What user roles and permissions will be needed within the application?
|
| 164 |
-
<client context>, How should user authentication and authorization be managed?
|
| 165 |
-
Reporting and Analytics:
|
| 166 |
-
<client context>, What types of analytics or reporting capabilities do you require within the application?
|
| 167 |
-
<client context>, Do you need real-time reporting, or are batch processes sufficient?
|
| 168 |
-
Deployment and Maintenance:
|
| 169 |
-
<client context>, Do you have any preferences for the deployment environment (e.g., cloud-based, on-premises)?
|
| 170 |
-
<client context>, What are your requirements for application maintenance and support post-deployment?
|
| 171 |
-
|
| 172 |
-
Instructions:
|
| 173 |
-
Replace <client context> with relevant information derived from the provided client background.
|
| 174 |
-
Only provide the list of formatted questions without any additional introduction or summary.
|
| 175 |
-
""",
|
| 176 |
-
inputs=['project_detail'],
|
| 177 |
-
outputs=['gathered_project_input'],
|
| 178 |
-
model=ModelType.O1_MINI,
|
| 179 |
-
description="Generate Context-Aware List Of Questions",
|
| 180 |
-
step="Chatbot Prompt Editors",
|
| 181 |
-
ui={
|
| 182 |
-
"gather_project_input_prompt_editor": UIConfig(
|
| 183 |
-
component_type=UIComponentType.TEXTBOX,
|
| 184 |
-
label="Gather Project Input Prompt",
|
| 185 |
-
lines=20,
|
| 186 |
-
interactive=True
|
| 187 |
-
)
|
| 188 |
-
}
|
| 189 |
-
),
|
| 190 |
-
|
| 191 |
-
"review_project_input": PromptConfig(
|
| 192 |
-
prompt=
|
| 193 |
-
"""
|
| 194 |
-
You are a Web Development Expert with extensive experience designing scalable, secure, and robust document processing applications. Your task is to review a detailed Q&A about a proposed document processing web application and identify gaps or ambiguities. Leverage frameworks such as the 5 Whys and root cause analysis for deeper exploration.
|
| 195 |
-
Ensure questions are tailored, referencing prior context or statements for precision.
|
| 196 |
-
Requirements:
|
| 197 |
-
You need to FULLY read the input which is given below client background information.
|
| 198 |
-
Generate follow-up questions to identify missing details or ambiguities.
|
| 199 |
-
Use specific references to prior responses for continuity. For example: "You mentioned [context]. Can you elaborate on [specific aspect]?"
|
| 200 |
-
Apply the 5 Whys to delve deeper where necessary. For example: " You mentioned [specific pain point]. Why does this occur, and what are the downstream impacts?"
|
| 201 |
-
Highlight systemic issues where patterns emerge (e.g., manual processes across multiple challenges).
|
| 202 |
-
# Output Format:
|
| 203 |
-
<index><question>(sample answers)
|
| 204 |
-
Just return the formatted list as string and nothing else.
|
| 205 |
-
""",
|
| 206 |
-
inputs=['project_detail'],
|
| 207 |
-
outputs=['reviewed_project_input'],
|
| 208 |
-
model=ModelType.O1_MINI,
|
| 209 |
-
description="Review project input",
|
| 210 |
-
step="Chatbot Prompt Editors",
|
| 211 |
-
ui={
|
| 212 |
-
"review_project_input_prompt_editor": UIConfig(
|
| 213 |
-
component_type=UIComponentType.TEXTBOX,
|
| 214 |
-
label="Review Project Input Prompt",
|
| 215 |
-
lines=20,
|
| 216 |
-
interactive=True
|
| 217 |
-
)
|
| 218 |
-
}
|
| 219 |
-
),
|
| 220 |
-
|
| 221 |
-
"generate_prd": PromptConfig(
|
| 222 |
-
prompt=
|
| 223 |
-
"""
|
| 224 |
-
Rewrite this for clarity while keeping ALL specific details, metrics, and constraints.
|
| 225 |
-
Please take note of the time constraint to build the MVP.
|
| 226 |
-
Do not include context or assumptions beyond the input provided.
|
| 227 |
-
Do not also exclude any input provided.
|
| 228 |
-
Structure the document to ensure clarity and logical flow.
|
| 229 |
-
Make sure to make the title "Project Requirements".
|
| 230 |
-
""",
|
| 231 |
-
inputs=["project_detail"],
|
| 232 |
-
outputs=["generated_prd"],
|
| 233 |
-
model=ModelType.O1_MINI,
|
| 234 |
-
description="Step 1.1 : Generate Project Requirements Document (PRD)",
|
| 235 |
-
step="Step 1 : Scope & Components",
|
| 236 |
-
ui={
|
| 237 |
-
"requirement_prompt_editor": UIConfig(
|
| 238 |
-
component_type=UIComponentType.TEXTBOX,
|
| 239 |
-
label="Requirements(PRD) System Prompt",
|
| 240 |
-
lines=20,
|
| 241 |
-
interactive=True
|
| 242 |
-
),
|
| 243 |
-
"generated_prd_text": UIConfig(
|
| 244 |
-
component_type=UIComponentType.TEXTBOX,
|
| 245 |
-
label="Requirements(PRD) Output",
|
| 246 |
-
lines=20,
|
| 247 |
-
visible=True
|
| 248 |
-
),
|
| 249 |
-
"generated_prd_markdown": UIConfig(
|
| 250 |
-
component_type=UIComponentType.MARKDOWN,
|
| 251 |
-
label="Requirements(PRD) Output",
|
| 252 |
-
visible=True,
|
| 253 |
-
show_copy_button=True
|
| 254 |
-
)
|
| 255 |
-
}
|
| 256 |
-
),
|
| 257 |
-
|
| 258 |
-
"generate_plan_test_components": PromptConfig(
|
| 259 |
-
prompt=
|
| 260 |
-
"""
|
| 261 |
-
Context:
|
| 262 |
-
You are an expert in software project planning and testing. Your task is to create a highly detailed, actionable, and project-specific Component List for a software project, focusing exclusively on the Planning and Testing phases. excluding Development phase. The response must align with the project's goals, technical stack, and compliance requirements, ensuring granularity, specificity, and adherence to the provided Project Requirement Document (PRD).
|
| 263 |
-
|
| 264 |
-
Instructions:
|
| 265 |
-
Break the project into the following phases:
|
| 266 |
-
1. Planning Phase ( Potention Focus: Requirement gathering,Technical architecture design, Resource Allocation.. etc)
|
| 267 |
-
2. Testing Phase ( Potention Focus: Integration testing, System testing, User Acceptance Testing (UAT) )
|
| 268 |
-
|
| 269 |
-
Components:
|
| 270 |
-
For each phase, include project-specific components that align with the goal of developing the software Project. Break down each phase into granular sub-components, ensuring specificity and alignment with the PRD.
|
| 271 |
-
Use the PRD to extract relevant, granular components that reflect deliverables unique to this project.
|
| 272 |
-
|
| 273 |
-
Output Format:
|
| 274 |
-
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 275 |
-
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
| 276 |
-
""",
|
| 277 |
-
inputs=["generated_prd"],
|
| 278 |
-
outputs=["generated_plan_test_components"],
|
| 279 |
-
model=ModelType.O1_MINI,
|
| 280 |
-
description="Step 1.2 : Generate planning and testing components",
|
| 281 |
-
step="Step 1 : Scope & Components",
|
| 282 |
-
ui={
|
| 283 |
-
"plan_test_component_prompt_editor": UIConfig(
|
| 284 |
-
component_type=UIComponentType.TEXTBOX,
|
| 285 |
-
label="Plan Test System Prompt",
|
| 286 |
-
lines=20,
|
| 287 |
-
interactive=True
|
| 288 |
-
),
|
| 289 |
-
"generated_plan_test_components_text": UIConfig(
|
| 290 |
-
component_type=UIComponentType.TEXTBOX,
|
| 291 |
-
label="Plan & Test Components Output",
|
| 292 |
-
lines=20,
|
| 293 |
-
visible=True
|
| 294 |
-
),
|
| 295 |
-
"generated_plan_test_components_markdown": UIConfig(
|
| 296 |
-
component_type=UIComponentType.MARKDOWN,
|
| 297 |
-
label="Plan & Test Components Output",
|
| 298 |
-
visible=True,
|
| 299 |
-
show_copy_button=True
|
| 300 |
-
)
|
| 301 |
-
}
|
| 302 |
-
),
|
| 303 |
-
|
| 304 |
-
"generate_dev_components": PromptConfig(
|
| 305 |
-
prompt=
|
| 306 |
-
"""
|
| 307 |
-
As a Senior Software Architect with 20+ years of experience, you are tasked to generate a detailed, actionable, and project-specific component list exclusively for the development phase of the project. The list must align with the project's goals, technical stack, and compliance requirements as outlined in the provided Project Requirement Document (PRD), ensuring granularity and specificity.
|
| 308 |
-
|
| 309 |
-
**Specific Requirements:**
|
| 310 |
-
1. Extract relevant **granular components** from the PRD that reflect the tasks and deliverables unique to this project.
|
| 311 |
-
2. Components should directly reference functionalities or deliverables related to the project.
|
| 312 |
-
3. Prioritize components that provide high business value, such as core functionality.
|
| 313 |
-
4. Organize components into logical categories such as Frontend, Backend, Integration Development, etc., with further subdivisions as needed. Avoid Testing, Support and Maintenance, Documentation, and Training components.
|
| 314 |
-
5. Ensure deliverables focus entirely on outcomes and deliverables, and consider edge cases, avoiding unnecessary instructions (i.e., avoid filler words).
|
| 315 |
-
6. Identify key business logic and special edge cases that need to be considered during development, which could impact the system's robustness or functionality.
|
| 316 |
-
7. **Include a separate section titled "Special Edge Cases Considerations"** to explicitly address unhappy paths. The deliverables in this section should focus solely on development outcomes to address these scenarios.
|
| 317 |
-
|
| 318 |
-
**Output Format:**
|
| 319 |
-
- Title: Component Name as Table Title (e.g., "Frontend Components")
|
| 320 |
-
- Table Structure:
|
| 321 |
-
- **Subcomponent**: Subcomponent name (e.g., "User Authentication and Authorization").
|
| 322 |
-
- **Task**: Task name (e.g., "Login Interface").
|
| 323 |
-
- **Deliverables**: Lists of technical outcomes or deliverables (e.g., "1. Deliverable 1 2. Deliverable 2 3. Deliverable ..."), as much as possible.
|
| 324 |
-
- **Special Edge Cases Considerations**: A separate table to address unhappy paths, with the same structure as above.
|
| 325 |
-
|
| 326 |
-
**Example:**
|
| 327 |
-
Frontend Component
|
| 328 |
-
| **Component** | **Task** | **Deliverables** |
|
| 329 |
-
|--------------------------------|------------------------------|----------------------------------------------------------------------------------------------------------|
|
| 330 |
-
| Document Upload Interface | Implement File Upload | 1. React-based file upload component<br>2. Drag-and-drop functionality<br>3. Progress bar for uploads |
|
| 331 |
-
|
| 332 |
-
**Special Edge Cases Considerations**
|
| 333 |
-
| **Component** | **Task** | **Deliverables** |
|
| 334 |
-
|--------------------------------|------------------------------|----------------------------------------------------------------------------------------------------------|
|
| 335 |
-
| Input Validation | Handle Invalid Inputs | 1. File format validation logic<br>2. File size validation logic<br>3. Error messaging UI for invalid inputs |
|
| 336 |
-
|
| 337 |
-
**Tech Stack:**
|
| 338 |
-
- Backend: FastAPI, Python
|
| 339 |
-
- Frontend: React
|
| 340 |
-
- Infrastructure: AWS, PostgreSQL, Redis, Docker, Alembic
|
| 341 |
-
|
| 342 |
-
**Objective:**
|
| 343 |
-
The final output should deliver a **clear, actionable, and project-specific list of components**, with a separate section for handling unhappy paths. The goal is to provide a foundation for developing granular subcomponents and tasks, ensuring alignment with the unique requirements of this project. A logical grouping and a clean structure that enhance the table's clarity and technical usability is expected.
|
| 344 |
-
""",
|
| 345 |
-
inputs=["generated_prd"],
|
| 346 |
-
outputs=["generated_dev_components"],
|
| 347 |
-
model=ModelType.O1_MINI,
|
| 348 |
-
description="Step 1.3 : Generate development components",
|
| 349 |
-
step="Step 1 : Scope & Components",
|
| 350 |
-
ui={
|
| 351 |
-
"dev_component_prompt_editor": UIConfig(
|
| 352 |
-
component_type=UIComponentType.TEXTBOX,
|
| 353 |
-
label="Development System Prompt",
|
| 354 |
-
lines=20,
|
| 355 |
-
interactive=True
|
| 356 |
-
),
|
| 357 |
-
"generated_dev_components_text": UIConfig(
|
| 358 |
-
component_type=UIComponentType.TEXTBOX,
|
| 359 |
-
label="Development Components Output",
|
| 360 |
-
lines=20,
|
| 361 |
-
visible=True
|
| 362 |
-
),
|
| 363 |
-
"generated_dev_components_markdown": UIConfig(
|
| 364 |
-
component_type=UIComponentType.MARKDOWN,
|
| 365 |
-
label="Developemnt Components Output",
|
| 366 |
-
visible=True,
|
| 367 |
-
show_copy_button=True
|
| 368 |
-
)
|
| 369 |
-
}
|
| 370 |
-
),
|
| 371 |
-
|
| 372 |
-
"reformat_dev_components": PromptConfig(
|
| 373 |
-
prompt=
|
| 374 |
-
"""
|
| 375 |
-
As a Senior Software Architect with 20+ years of experience, you are tasked to reformat the generated development components for a document extraction project to ensure consistent and standardized naming conventions. The reformatted components must align with the project's goals, technical stack, and compliance requirements as outlined in the provided Project Requirement Document (PRD).
|
| 376 |
-
|
| 377 |
-
**Specific Requirements:**
|
| 378 |
-
1. **Standardize Naming Conventions**:
|
| 379 |
-
- Use **descriptive and intuitive names** for components, subcomponents, tasks, and deliverables.
|
| 380 |
-
- Ensure naming is **consistent across all tables** (Frontend, Backend, Integration, Infrastructure, Database, and Special Edge Cases).
|
| 381 |
-
- Avoid overly technical jargon unless necessary for clarity.
|
| 382 |
-
- Use **action-oriented language** for tasks and deliverables (e.g., "Implement file upload functionality" instead of "File upload functionality").
|
| 383 |
-
|
| 384 |
-
2. **Common Web Development Document Extraction Components**:
|
| 385 |
-
- Include standard components such as:
|
| 386 |
-
- **Document Upload Interface**
|
| 387 |
-
- **Document Processing Engine**
|
| 388 |
-
- **Data Validation Module**
|
| 389 |
-
- **OCR Integration**
|
| 390 |
-
- **Data Reconciliation Module**
|
| 391 |
-
- **Report Generation Interface**
|
| 392 |
-
- **User Authentication and Authorization**
|
| 393 |
-
- **Notification and Alert System**
|
| 394 |
-
- **API Integrations**
|
| 395 |
-
- **Database Schema Design**
|
| 396 |
-
- **Error Handling and Logging**
|
| 397 |
-
- **Scalability and Load Balancing**
|
| 398 |
-
|
| 399 |
-
3. **Reformat the Generated Components**:
|
| 400 |
-
- Ensure all components, subcomponents, tasks, and deliverables follow the standardized naming conventions.
|
| 401 |
-
- Group related tasks and deliverables under the appropriate subcomponents.
|
| 402 |
-
- Maintain a clean and logical structure for readability and technical usability.
|
| 403 |
-
|
| 404 |
-
**Output Format:**
|
| 405 |
-
- Title: Component Name as Table Title (e.g., "Frontend Components")
|
| 406 |
-
- Table Structure:
|
| 407 |
-
- **Subcomponent**: Subcomponent name (e.g., "Document Upload Interface").
|
| 408 |
-
- **Task**: Task name (e.g., "Implement file upload functionality").
|
| 409 |
-
- **Deliverables**: Lists of technical outcomes or deliverables
|
| 410 |
-
""",
|
| 411 |
-
inputs=["generated_dev_components"],
|
| 412 |
-
outputs=["reformatted_dev_components"],
|
| 413 |
-
model=ModelType.O1_MINI,
|
| 414 |
-
description="Step 1.4 : Reformat development components",
|
| 415 |
-
step="Step 1 : Scope & Components",
|
| 416 |
-
ui={
|
| 417 |
-
"reformatted_dev_components_prompt_editor": UIConfig(
|
| 418 |
-
component_type=UIComponentType.TEXTBOX,
|
| 419 |
-
label="Reformatted Development Components",
|
| 420 |
-
lines=20,
|
| 421 |
-
interactive=True
|
| 422 |
-
),
|
| 423 |
-
"reformatted_dev_components_text": UIConfig(
|
| 424 |
-
component_type=UIComponentType.TEXTBOX,
|
| 425 |
-
label="Reformatted Development Components Output",
|
| 426 |
-
lines=20,
|
| 427 |
-
visible=True
|
| 428 |
-
),
|
| 429 |
-
"reformatted_dev_components_markdown": UIConfig(
|
| 430 |
-
component_type=UIComponentType.MARKDOWN,
|
| 431 |
-
label="Reformatted Development Components Markdown Output",
|
| 432 |
-
visible=True,
|
| 433 |
-
show_copy_button=True
|
| 434 |
-
)
|
| 435 |
-
}
|
| 436 |
-
),
|
| 437 |
-
|
| 438 |
-
"generate_plan_test_mandays": PromptConfig(
|
| 439 |
-
prompt=
|
| 440 |
-
"""
|
| 441 |
-
You are an experienced project manager tasked to create a detailed task breakdown for a project based on the planning and testing component list.
|
| 442 |
-
|
| 443 |
-
Objective:
|
| 444 |
-
Generate a structured CSV output with manday estimates for each planning and testing component.
|
| 445 |
-
|
| 446 |
-
Instructions:
|
| 447 |
-
1. Use the planning and testing component list to identify all components
|
| 448 |
-
2. For each component:
|
| 449 |
-
- Estimate mandays between 0.2 and 5 days based on real-world complexity
|
| 450 |
-
- Provide a clear description of deliverables and outcomes
|
| 451 |
-
- Ensure estimates account for potential delays or complications
|
| 452 |
-
|
| 453 |
-
Output Format Requirements:
|
| 454 |
-
- Generate a CSV with EXACTLY these column headers: "component,mandays,description"
|
| 455 |
-
- Each row must have all three columns filled
|
| 456 |
-
- Numeric values should not be quoted
|
| 457 |
-
- Text values must be enclosed in double quotes
|
| 458 |
-
- No empty rows or missing values
|
| 459 |
-
|
| 460 |
-
Example Output:
|
| 461 |
-
component,mandays,description
|
| 462 |
-
"Project Planning",2.5,"Detailed project planning including timeline and resource allocation"
|
| 463 |
-
"Requirements Analysis",1.5,"Analysis and documentation of system requirements"
|
| 464 |
-
|
| 465 |
-
Return only the CSV content, no code blocks or additional text.
|
| 466 |
-
""",
|
| 467 |
-
inputs=["generated_plan_test_components"],
|
| 468 |
-
outputs=["generated_plan_test_mandays"],
|
| 469 |
-
model=ModelType.O1_MINI,
|
| 470 |
-
description="Step 2.1 : Generate planning and testing mandays",
|
| 471 |
-
step="Step 2 : Mandays & Quotation",
|
| 472 |
-
sub_step="Step 2.1 : Generate Mandays",
|
| 473 |
-
ui={
|
| 474 |
-
"plan_test_mandays_prompt_editor": UIConfig(
|
| 475 |
-
component_type=UIComponentType.TEXTBOX,
|
| 476 |
-
label="Planning & Testing Mandays System Prompt",
|
| 477 |
-
lines=20,
|
| 478 |
-
interactive=True
|
| 479 |
-
),
|
| 480 |
-
"generated_plan_test_mandays_dataframe": UIConfig(
|
| 481 |
-
component_type=UIComponentType.DATAFRAME,
|
| 482 |
-
label="Plan & Test Mandays",
|
| 483 |
-
interactive=True
|
| 484 |
-
)
|
| 485 |
-
}
|
| 486 |
-
),
|
| 487 |
-
|
| 488 |
-
"generate_dev_mandays": PromptConfig(
|
| 489 |
-
prompt=
|
| 490 |
-
"""
|
| 491 |
-
You are an experienced project manager tasked to create a detailed task breakdown for development components.
|
| 492 |
-
|
| 493 |
-
Objective:
|
| 494 |
-
Generate a structured CSV output with manday estimates for each development component and subcomponent from the provided development component list.
|
| 495 |
-
|
| 496 |
-
Critical CSV Format Requirements:
|
| 497 |
-
1. First line MUST be exactly: component,subcomponent,mandays,description
|
| 498 |
-
2. Each subsequent line MUST contain actual data with:
|
| 499 |
-
- component: quoted text (e.g., "Frontend", "Backend")
|
| 500 |
-
- subcomponent: quoted text (e.g., "User Authentication", "API Development")
|
| 501 |
-
- mandays: unquoted number between 0.5 and 7 (e.g., 3.5, 2.0)
|
| 502 |
-
- description: quoted text describing the work
|
| 503 |
-
3. No empty lines or missing values
|
| 504 |
-
4. Text values must be in double quotes
|
| 505 |
-
5. Numbers must not be in quotes
|
| 506 |
-
|
| 507 |
-
Example Valid Output:
|
| 508 |
-
component,subcomponent,mandays,description
|
| 509 |
-
"Frontend","User Authentication",3.5,"Implementation of login/logout functionality with security features"
|
| 510 |
-
"Frontend","Dashboard UI",2.5,"Development of main dashboard interface with data visualization"
|
| 511 |
-
"Backend","API Development",4,"Development of REST APIs for data processing"
|
| 512 |
-
"Backend","Database Integration",2,"Implementation of database connections and queries"
|
| 513 |
-
"Infrastructure","Docker Setup",1.5,"Container configuration and deployment setup"
|
| 514 |
-
"Infrastructure","CI/CD Pipeline",2,"Setup of automated build and deployment pipeline"
|
| 515 |
-
|
| 516 |
-
Instructions:
|
| 517 |
-
1. Parse the provided development component list
|
| 518 |
-
2. For EACH component and subcomponent in the list:
|
| 519 |
-
- Create at least one row in the CSV
|
| 520 |
-
- Estimate realistic mandays (0.5-7 days)
|
| 521 |
-
- Write clear descriptions
|
| 522 |
-
3. Return ONLY the CSV content - no explanations or code blocks
|
| 523 |
-
|
| 524 |
-
YOU MUST GENERATE ACTUAL DATA ROWS based on the development component list provided.
|
| 525 |
-
""",
|
| 526 |
-
inputs=["reformatted_dev_components"],
|
| 527 |
-
outputs=["generated_dev_mandays"],
|
| 528 |
-
model=ModelType.O1_MINI,
|
| 529 |
-
description="Step 2.1 : Generate development mandays",
|
| 530 |
-
step="Step 2 : Mandays & Quotation",
|
| 531 |
-
sub_step="Step 2.1 : Generate Mandays",
|
| 532 |
-
ui={
|
| 533 |
-
"dev_mandays_prompt_editor": UIConfig(
|
| 534 |
-
component_type=UIComponentType.TEXTBOX,
|
| 535 |
-
label="Dev Mandays System Prompt",
|
| 536 |
-
lines=20,
|
| 537 |
-
interactive=True
|
| 538 |
-
),
|
| 539 |
-
"generated_dev_mandays_dataframe": UIConfig(
|
| 540 |
-
component_type=UIComponentType.DATAFRAME,
|
| 541 |
-
label="Dev Mandays",
|
| 542 |
-
interactive=True
|
| 543 |
-
)
|
| 544 |
-
}
|
| 545 |
-
),
|
| 546 |
-
|
| 547 |
-
"generate_mvp_prd": PromptConfig(
|
| 548 |
-
prompt=
|
| 549 |
-
"""
|
| 550 |
-
Generate a comprehensive and structured Project Requirement Document (PRD) for a Minimum Viable Product (MVP) using the following inputs:
|
| 551 |
-
1. **General PRD Guidelines**: Use the provided general PRD as a framework for structure, tone, and level of detail. This includes sections like Introduction, Scope, Functional Requirements, Non-Functional Requirements, Technical Architecture, Workflow, Testing, Deployment, and Appendices.
|
| 552 |
-
2. **MVP Components**: Incorporate the specific MVP components, including their descriptions, mandays estimates, and functionalities, into the relevant sections of the PRD. Ensure all details are accurately reflected.
|
| 553 |
-
|
| 554 |
-
Follow these instructions:
|
| 555 |
-
- Retain ALL specific details, metrics, and constraints from both the general PRD and MVP components.
|
| 556 |
-
- Pay special attention to the time constraint for building the MVP, as outlined in the inputs.
|
| 557 |
-
- Do not add any context or assumptions beyond the provided inputs.
|
| 558 |
-
- Do not exclude any details from the inputs.
|
| 559 |
-
- Structure the document to ensure clarity, logical flow, and readability and use tabular format whenever possible.
|
| 560 |
-
- Use the title "Project Requirements" for the document.
|
| 561 |
-
|
| 562 |
-
The output should be a well-organized PRD that combines the general PRD guidelines with the specific MVP components, ensuring alignment with the project's goals and constraints.
|
| 563 |
-
""",
|
| 564 |
-
inputs=["generated_prd" , "mvp_components"],
|
| 565 |
-
outputs=["generated_mvp_prd"],
|
| 566 |
-
model=ModelType.O1_MINI,
|
| 567 |
-
description="Step 3.1 : Generate MVP PRD",
|
| 568 |
-
step="Step 3 : Final Documentation",
|
| 569 |
-
ui={
|
| 570 |
-
"mvp_prd_prompt_editor": UIConfig(
|
| 571 |
-
component_type=UIComponentType.TEXTBOX,
|
| 572 |
-
label="MVP PRD System Prompt",
|
| 573 |
-
lines=20,
|
| 574 |
-
interactive=True
|
| 575 |
-
),
|
| 576 |
-
"generated_mvp_prd_text": UIConfig(
|
| 577 |
-
component_type=UIComponentType.TEXTBOX,
|
| 578 |
-
label="MVP PRD Output",
|
| 579 |
-
lines=20,
|
| 580 |
-
visible=True
|
| 581 |
-
),
|
| 582 |
-
"generated_mvp_prd_markdown": UIConfig(
|
| 583 |
-
component_type=UIComponentType.MARKDOWN,
|
| 584 |
-
label="MVP PRD Output",
|
| 585 |
-
visible=True,
|
| 586 |
-
show_copy_button=True
|
| 587 |
-
)
|
| 588 |
-
}
|
| 589 |
-
),
|
| 590 |
-
|
| 591 |
-
"generate_BD_SOW": PromptConfig(
|
| 592 |
-
prompt=
|
| 593 |
-
"""
|
| 594 |
-
As an project manager with 20+ years of experience, you are tasked to create a detailed Scope of Work (SOW) document. Analyze the provided project component list and scope document to generate the following sections. Follow the guidelines below to ensure a professional, structured, and client-ready output:
|
| 595 |
-
|
| 596 |
-
### **Scope of Work (SOW)**
|
| 597 |
-
#### **1. Project Background**
|
| 598 |
-
- Provide a brief overview of the project, including the context, problem statement, and why the project is being initiated.
|
| 599 |
-
- Break down key challenges (in bullet point) the company currently facing, quantifying the impacts where possible (e.g., lost revenue, downtime).
|
| 600 |
-
- Close this section with industry trends or other relevant background information, emphasizing risks of inaction leading to the project, in 2-3 sentenc
|
| 601 |
-
#### **2. Project Objective**
|
| 602 |
-
- Clearly define the project's primary goals and what constitutes success, using the following structure:
|
| 603 |
-
- Goals: List specific, measurable goals (e.g., reduce processing time by 20%).
|
| 604 |
-
- Outcomes: Describe tangible deliverables and metrics for succe
|
| 605 |
-
#### **3. Project Buyers & Stakeholders**
|
| 606 |
-
- List key stakeholders involved in the project, e.g. buyers, end-users, and decision-makers.
|
| 607 |
-
- Identify their name and roles in the project, using a tab
|
| 608 |
-
#### **4. System Flow**
|
| 609 |
-
- Provide description of how the system components interact, describing what each module does and how it works.
|
| 610 |
-
- Use one of the following:
|
| 611 |
-
- Visual Representation: Diagram illustrating workflows or data flows between modules.
|
| 612 |
-
- Textual Description: Detailed explanation of the processes and transitions
|
| 613 |
-
- Use bullet point, ensure simplicity and avoid overly technical language
|
| 614 |
-
#### **5. Modules and Functional Requirements Breakdown**
|
| 615 |
-
- LEAVE THIS BLANK
|
| 616 |
-
#### **6. Acceptance Criteria**
|
| 617 |
-
- Define conditions to be met, including specific, measurable criteria for project completion:
|
| 618 |
-
- Link each deliverable/module to its validation or testing process (e.g., UAT).
|
| 619 |
-
- Table format with the following column:
|
| 620 |
-
- Deliverable (e.g. Field Matching Automation module)
|
| 621 |
-
- Criteria, starting with "able to" (e.g. able to extract, match, and change the case status according
|
| 622 |
-
#### **7. Assumptions and Pre-requisites**
|
| 623 |
-
- List all planning-phase assumptions and pre-requisites, grouped into:
|
| 624 |
-
- Assumptions: Detailed, scenario-based assumptions that the project relies on. Each assumption should:
|
| 625 |
-
- Reference specific stakeholders (e.g., PWT staff, Mindhive).
|
| 626 |
-
- Describe specific conditions or expectations (e.g., document quality, workflow stability).
|
| 627 |
-
- Be written in clear, concise language.
|
| 628 |
-
- Pre-requisites or dependencies: Conditions that must be met before the project can proceed. Each pre-requisite should:
|
| 629 |
-
- Be specific and actionable.
|
| 630 |
-
- Reference who is responsible and what needs to be do
|
| 631 |
-
#### **8. Proposed Timeline**
|
| 632 |
-
- Provide a project timeline, including:
|
| 633 |
-
- Milestone
|
| 634 |
-
- Expected Date/Duration
|
| 635 |
-
- Outcome/Deliverable
|
| 636 |
-
- Use a Gantt chart or table to visualize the timeline.
|
| 637 |
-
- Ensure the output are clean, organized, and easy to read
|
| 638 |
-
#### **9. Commercial**
|
| 639 |
-
Summarize the project's commercial details in the following subsections:
|
| 640 |
-
- Development Fee: Create a table summarizing the costs for development, including the product, technical work supporting, or other additional services provided
|
| 641 |
-
- Subscription Fee: If applicable, create a table summarizing subscription fees for system usage.
|
| 642 |
-
- Payment Terms: Include a text description of payment terms:
|
| 643 |
-
- Milestones: Specify at which stages payments are due
|
| 644 |
-
- Invoicing: Define invoicing intervals (e.g., monthly, quarterly) and payment deadlines
|
| 645 |
-
- Other Terms: Mention late payment fees or additional terms, if applicable
|
| 646 |
-
- Output Format for tables: {Service}, {Fee} (leave amount blank)
|
| 647 |
-
#### **10. Sign-Off**
|
| 648 |
-
- Create a professional and formal Sign-Off section to acknowledge and approve the SOW.
|
| 649 |
-
- Include an statement to clearly communicate that both parties have reviewed and agreed to the SOW.
|
| 650 |
-
- Provide placeholder for each party (Company):
|
| 651 |
-
- Signature
|
| 652 |
-
- Name
|
| 653 |
-
- Position
|
| 654 |
-
- Date
|
| 655 |
-
#### **Guidelines**
|
| 656 |
-
- Use bullet points for clarity.
|
| 657 |
-
- Keep descriptions concise and client-friendly; avoid technical jargon unless necessary.
|
| 658 |
-
- Maintain structured sections and tables for readability.
|
| 659 |
-
Expected output should be professional, well-structured, and designed to help clients and stakeholders clearly understand the project scope. I'm going to tip you for a better outcome!
|
| 660 |
-
""",
|
| 661 |
-
inputs=["generated_prd", "generated_plan_test_components", "reformatted_dev_components", "quotation_cost"],
|
| 662 |
-
outputs=["generated_BD_SOW"],
|
| 663 |
-
model=ModelType.O1_MINI,
|
| 664 |
-
description="Step 3.2 : Generate BD SOW",
|
| 665 |
-
step="Step 3 : Final Documentation",
|
| 666 |
-
ui={
|
| 667 |
-
"BD_SOW_prompt_editor": UIConfig(
|
| 668 |
-
component_type=UIComponentType.TEXTBOX,
|
| 669 |
-
label="BD SOW System Prompt",
|
| 670 |
-
lines=20,
|
| 671 |
-
interactive=True
|
| 672 |
-
),
|
| 673 |
-
"generated_BD_SOW_text": UIConfig(
|
| 674 |
-
component_type=UIComponentType.TEXTBOX,
|
| 675 |
-
label="BD SOW Doc",
|
| 676 |
-
lines=20,
|
| 677 |
-
visible=True
|
| 678 |
-
),
|
| 679 |
-
"generated_BD_SOW_markdown": UIConfig(
|
| 680 |
-
component_type=UIComponentType.MARKDOWN,
|
| 681 |
-
label="BD SOW Doc",
|
| 682 |
-
visible=True,
|
| 683 |
-
show_copy_button=True
|
| 684 |
-
)
|
| 685 |
-
}
|
| 686 |
-
),
|
| 687 |
-
|
| 688 |
-
"generate_Tech_SOW": PromptConfig(
|
| 689 |
-
prompt=
|
| 690 |
-
"""
|
| 691 |
-
As an experienced project manager with over 20 years of expertise, you are tasked to create a detailed Scope of Work (SOW) document in JSON format. The JSON output should contain markdown-formatted strings as values for each section of the SOW. Analyze the provided project component list and scope document to generate the following sections:
|
| 692 |
-
|
| 693 |
-
### **Scope of Work (SOW)**
|
| 694 |
-
|
| 695 |
-
#### **1. Scope Summary**
|
| 696 |
-
- Provide a concise, high-level overview of the project scope. Divide it into three subsections:
|
| 697 |
-
- **In Scope:**
|
| 698 |
-
- List all deliverables, functionalities, and modules included in the project.
|
| 699 |
-
- Be specific about what will be developed, implemented, or delivered.
|
| 700 |
-
- Include MVP components (e.g., basic features, functionality, UI, document processing).
|
| 701 |
-
- **Assumptions:**
|
| 702 |
-
- Highlight key project-specific assumptions that the project relies on.
|
| 703 |
-
- **Dependencies:**
|
| 704 |
-
- List all internal and external dependencies required for the project's success.
|
| 705 |
-
- Include any third-party integrations, resources, or timelines that the project depends on.
|
| 706 |
-
|
| 707 |
-
#### **2. Modules and Functional Requirements Breakdown**
|
| 708 |
-
- Break down the project into modules or components.
|
| 709 |
-
- Present the details in a succinct and client-friendly table with the following columns:
|
| 710 |
-
- **Module**
|
| 711 |
-
- **Functionalities/Features**
|
| 712 |
-
- **Notes for any special considerations or constraints (e.g., 'Supports files up to 100MB')**
|
| 713 |
-
- Use clear, concise, non-technical language. (e.g., 'Drag-and-drop support for PDFs, Excel, CSV; progress indicators'). Avoid excessive detail.
|
| 714 |
-
- Include MVP components as part of the breakdown and provide clear functionalities related to those (e.g., basic document upload, UI features, data processing).
|
| 715 |
-
|
| 716 |
-
#### **3. Out of Scope**
|
| 717 |
-
- Explicitly define what is excluded from the project's scope. This may include any functionalities, tasks, or deliverables.
|
| 718 |
-
- Ensure clarity to prevent future misunderstandings.
|
| 719 |
-
|
| 720 |
-
#### **4. System Flow**
|
| 721 |
-
- Provide a detailed, step-by-step description of how the system components interact.
|
| 722 |
-
- For each component or module:
|
| 723 |
-
- Describe what it does and how it works, including both success and unsuccessful scenarios.
|
| 724 |
-
- Explain how it interacts with other components.
|
| 725 |
-
- Include MVP-related components in the system flow, describing their function and interaction within the MVP's framework.
|
| 726 |
-
|
| 727 |
-
Output Requirements:
|
| 728 |
-
Just return the JSON object and nothing else, omit code guards ```, where each key represents a section of the SOW, and the value is a markdown-formatted string for that section.
|
| 729 |
-
Use clear, concise, and client-friendly language. Avoid excessive technical jargon unless necessary.
|
| 730 |
-
Example JSON Output:
|
| 731 |
-
{
|
| 732 |
-
"scope_summary": <markdown content>,
|
| 733 |
-
"modules_and_functional_requirements": <markdown content>,
|
| 734 |
-
"out_of_scope": <markdown content>,
|
| 735 |
-
"system_flow": <markdown content>
|
| 736 |
-
}
|
| 737 |
-
""",
|
| 738 |
-
inputs=["generated_plan_test_components", "reformatted_dev_components" ,"mvp_components"],
|
| 739 |
-
outputs=["generated_Tech_SOW"],
|
| 740 |
-
model=ModelType.O1_MINI,
|
| 741 |
-
description="Step 3.3 : Generate Tech SOW",
|
| 742 |
-
step="Step 3 : Final Documentation",
|
| 743 |
-
ui={
|
| 744 |
-
"Tech_SOW_prompt_editor": UIConfig(
|
| 745 |
-
component_type=UIComponentType.TEXTBOX,
|
| 746 |
-
label="Technical SOW System Prompt",
|
| 747 |
-
lines=20,
|
| 748 |
-
interactive=True
|
| 749 |
-
),
|
| 750 |
-
"generated_Tech_SOW_text": UIConfig(
|
| 751 |
-
component_type=UIComponentType.TEXTBOX,
|
| 752 |
-
label="Technical SOW Doc",
|
| 753 |
-
lines=20,
|
| 754 |
-
visible=True
|
| 755 |
-
),
|
| 756 |
-
"generated_Tech_SOW_markdown": UIConfig(
|
| 757 |
-
component_type=UIComponentType.MARKDOWN,
|
| 758 |
-
label="Technical SOW Doc",
|
| 759 |
-
visible=True,
|
| 760 |
-
show_copy_button=True
|
| 761 |
-
)
|
| 762 |
-
}
|
| 763 |
-
),
|
| 764 |
-
|
| 765 |
-
"analyze_planning_testing_mandays": PromptConfig(
|
| 766 |
-
prompt=
|
| 767 |
-
"""
|
| 768 |
-
You are an experienced project manager tasked with analyzing the provided planning and testing mandays estimates. Your goal is to identify the highest priority components that must be completed to build the MVP. Focus on components that deliver **immediate value to users** and are **critical for the core functionality** of the product.
|
| 769 |
-
|
| 770 |
-
Objective:
|
| 771 |
-
Identify the highest priority planning and testing components that are critical for the MVP's core functionality and deliver immediate value to the business. Exclude all non-critical components that do not directly contribute to the MVP's primary functionality.
|
| 772 |
-
|
| 773 |
-
Key Guidelines:
|
| 774 |
-
- Focus on Core Functionality: Only include components that are essential for the MVP to function and deliver immediate value to users.
|
| 775 |
-
- Exclude Non-Critical Components: Do not include components related to advanced security, compliance, scalability, authentication, fallback mechanisms, or any feature that is not absolutely necessary for the MVP.
|
| 776 |
-
- Prioritize Business Value: Ensure the selected components align with the business's core objectives and deliver measurable value.
|
| 777 |
-
- Minimalistic Approach: Focus on the least effort required to deliver the most value.
|
| 778 |
-
|
| 779 |
-
Output Format Requirements:
|
| 780 |
-
- Provide a clear list of identified priority planning/testing components with a brief justification for each selection.
|
| 781 |
-
- Ensure the output is concise and actionable.
|
| 782 |
-
""",
|
| 783 |
-
inputs=["generated_plan_test_mandays"],
|
| 784 |
-
outputs=["identified_planning_testing_components"],
|
| 785 |
-
model=ModelType.O1_MINI,
|
| 786 |
-
description="Step 2.2 : Analyze planning and testing components",
|
| 787 |
-
step="Step 2 : Mandays & Quotation",
|
| 788 |
-
sub_step="Step 2.2 : Analyze Components",
|
| 789 |
-
ui={
|
| 790 |
-
"planning_testing_prompt_editor": UIConfig(
|
| 791 |
-
component_type=UIComponentType.TEXTBOX,
|
| 792 |
-
label="Plan & Test Components Analysis Prompt",
|
| 793 |
-
lines=20,
|
| 794 |
-
interactive=True
|
| 795 |
-
),
|
| 796 |
-
}
|
| 797 |
-
),
|
| 798 |
-
|
| 799 |
-
"analyze_development_mandays": PromptConfig(
|
| 800 |
-
prompt=
|
| 801 |
-
"""
|
| 802 |
-
You are an experienced project manager tasked with analyzing the provided development mandays estimates. Your goal is to assign a priority level to each development component based on its importance to the MVP's core functionality and business value. Focus exclusively on components that deliver immediate value to users and are critical for the core functionality of the product.
|
| 803 |
-
|
| 804 |
-
Key Guidelines:
|
| 805 |
-
- **Focus on Core Functionality:** Assign priority levels based on how essential each component is for the MVP to function and deliver immediate value to users.
|
| 806 |
-
- **Exclude Non-Critical Considerations:** Do not label components related to advanced security, compliance, scalability, authentication, fallback mechanisms, or any feature that is **NOT** absolutely necessary for the MVP as "high" priority.
|
| 807 |
-
- **Prioritize Business Value:** Ensure the priority levels align with the business's core objectives and deliver measurable value.
|
| 808 |
-
- **Minimalistic Approach:** Focus on the least effort required to deliver the most value when assigning priority levels.
|
| 809 |
-
- **Assign Priority Levels:** Label each development component as "high," "medium," or "low" priority based on its importance to the MVP's core functionality and business value.
|
| 810 |
-
|
| 811 |
-
Objective:
|
| 812 |
-
Assign a priority level ("high," "medium," or "low") to each development component, ensuring the output reflects the importance of each component to the MVP's core functionality and business value. Retain all original components in the list.
|
| 813 |
-
|
| 814 |
-
Output Format Requirements:
|
| 815 |
-
- Provide a list of all development components with their assigned priority levels.
|
| 816 |
-
- Include a "Priority" column labeling each component as "high," "medium," or "low."
|
| 817 |
-
- Ensure the output is concise and actionable.
|
| 818 |
-
|
| 819 |
-
Important Notes:
|
| 820 |
-
- If a component is not directly tied to the core functionality or can be deferred to a later phase, assign it a lower priority ("medium" or "low").
|
| 821 |
-
- Do not exclude any components from the list, even if they are low priority.
|
| 822 |
-
- Only assign "high" priority to components that are absolutely necessary for the MVP to function.
|
| 823 |
-
""",
|
| 824 |
-
inputs=["generated_dev_mandays"],
|
| 825 |
-
outputs=["identified_development_components"],
|
| 826 |
-
model=ModelType.O1_MINI,
|
| 827 |
-
description="Step 2.2 : Analyze development components",
|
| 828 |
-
step="Step 2 : Mandays & Quotation",
|
| 829 |
-
sub_step="Step 2.2 : Analyze Components",
|
| 830 |
-
ui={
|
| 831 |
-
"development_prompt_editor": UIConfig(
|
| 832 |
-
component_type=UIComponentType.TEXTBOX,
|
| 833 |
-
label="Development Components Analysis Prompt",
|
| 834 |
-
lines=20,
|
| 835 |
-
interactive=True
|
| 836 |
-
),
|
| 837 |
-
}
|
| 838 |
-
),
|
| 839 |
-
|
| 840 |
-
"recalculate_mandays": PromptConfig(
|
| 841 |
-
prompt=
|
| 842 |
-
"""
|
| 843 |
-
Based on the identified priority components from the previous analysis, your task is to recalculate the mandays estimates to ensure they fit within the time given (e.g., days or weeks) in building the MVP mentioned in the Project Requirement Document (PRD).
|
| 844 |
-
|
| 845 |
-
Objective:
|
| 846 |
-
Reread the entire PRD to identify the timelimit of the MVP, then Recalculate the manday estimates for the identified priority development components to ensure they fit within the timeline specified in the Project Requirement Document (PRD) to build the MVP. Adjust development mandays while maintaining feasibility and ensuring core functionality delivery.
|
| 847 |
-
|
| 848 |
-
Key Guidelines:
|
| 849 |
-
1. Convert Time Estimates: Convert all time estimates into raw mandays:
|
| 850 |
-
- 1 week = 7 mandays
|
| 851 |
-
- 1 month = 28-31 mandays
|
| 852 |
-
- If input is in days, use as is.
|
| 853 |
-
- If input is a range (e.g., 1-2 weeks), use the average (1.5 weeks = 7.5 mandays).
|
| 854 |
-
2. **Preserve All Components:** Do not remove any components from the list, even if they are low priority.
|
| 855 |
-
3. **Adjust Mandays Based on Priority:**
|
| 856 |
-
- For **high priority components**, allocate the majority of mandays (eg: 1-3) to ensure critical functionalities are minimally viable. However , components such as authentication , security , etc. can be set to 0.
|
| 857 |
-
- For **medium priority components**, allocate minimal mandays (eg: 1-2) or set them to 0, as these can be deferred without impacting core functionalities.
|
| 858 |
-
- For **low priority components**, set mandays to 0, as these are not essential for the MVP.
|
| 859 |
-
4. Retain Planning/Testing Components: All identified planning and testing components must be retained in the list but have their mandays set to 0. Do not remove them.
|
| 860 |
-
5. **Iterative Adjustment:** If the total mandays for the development components still exceed the MVP timeline after the first adjustment, further reduce or set the mandays to 0 on high and medium priority components if necessary until the total fits within the timeline.
|
| 861 |
-
- **MVP Timeline Constraint:** Ensure the final total mandays do not exceed the MVP timeline.
|
| 862 |
-
6. Justify Adjustments: Provide a brief explanation for any adjustments made to the mandays, ensuring they align with the timeline and maintain the MVP's core functionality.
|
| 863 |
-
|
| 864 |
-
Output Format Requirements:
|
| 865 |
-
- Provide a revised list of development components with updated mandays estimates.
|
| 866 |
-
- Include the "Priority" column for reference.
|
| 867 |
-
- Include the total mandays for the revised plan and confirm whether it fits within the MVP timeline.
|
| 868 |
-
- Ensure the output is concise and actionable.
|
| 869 |
-
|
| 870 |
-
Important Notes:
|
| 871 |
-
- If the total mandays still exceed the timeline after adjustments, prioritize further reductions in medium priority components while keeping high priority components as intact as possible.
|
| 872 |
-
- Do not remove any components from the list, even if their mandays are reduced to 0.
|
| 873 |
-
""",
|
| 874 |
-
inputs=["identified_priority_components", "generated_prd"],
|
| 875 |
-
outputs=["revised_mandays_estimates"],
|
| 876 |
-
model=ModelType.O1_MINI,
|
| 877 |
-
description="Step 2.3 : Recalculate Mandays",
|
| 878 |
-
step="Step 2 : Mandays & Quotation",
|
| 879 |
-
sub_step="Step 2.3 : Recalculate MVP Mandays",
|
| 880 |
-
ui={
|
| 881 |
-
"mandays_recalculation_prompt_editor": UIConfig(
|
| 882 |
-
component_type=UIComponentType.TEXTBOX,
|
| 883 |
-
label="Mandays Recalculation Prompt",
|
| 884 |
-
lines=20,
|
| 885 |
-
interactive=True
|
| 886 |
-
)
|
| 887 |
-
}
|
| 888 |
-
),
|
| 889 |
-
|
| 890 |
-
"generate_MVP_mandays": PromptConfig(
|
| 891 |
-
prompt=
|
| 892 |
-
"""
|
| 893 |
-
Using the revised mandays estimates from the previous step, format the output into two clearly separated CSV sections: one for Planning/Testing Components and another for Development Components.
|
| 894 |
-
|
| 895 |
-
Objective:
|
| 896 |
-
Structure the output to clearly delineate the two sections while maintaining the original column structure.
|
| 897 |
-
|
| 898 |
-
Output Format Requirements:
|
| 899 |
-
- First Section - Planning & Testing Components:
|
| 900 |
-
component,mandays,description
|
| 901 |
-
"Requirements Analysis",0,"Critical user requirements and system specifications"
|
| 902 |
-
|
| 903 |
-
- Second Section - Development Components:
|
| 904 |
-
component,subcomponent,mandays,description
|
| 905 |
-
"Backend","Core API Development",3,"Essential API endpoints for basic functionality"
|
| 906 |
-
|
| 907 |
-
Important:
|
| 908 |
-
- Each section must maintain its original column structure.
|
| 909 |
-
- Sections MUST be separated by the marker: "---SECTION BREAK---".
|
| 910 |
-
- Include ALL components and NOT change anything.
|
| 911 |
-
- No empty rows or missing values.
|
| 912 |
-
- Text values must be in double quotes.
|
| 913 |
-
- Numbers must not be in quotes.
|
| 914 |
-
|
| 915 |
-
Return only the CSV content with the section break, no additional text or explanations.
|
| 916 |
-
""",
|
| 917 |
-
inputs=["revised_mandays_estimates"],
|
| 918 |
-
outputs=["generated_MVP_mandays"],
|
| 919 |
-
model=ModelType.O1_MINI,
|
| 920 |
-
description="Step 2.3 : Generate MVP Mandays",
|
| 921 |
-
step="Step 2 : Mandays & Quotation",
|
| 922 |
-
sub_step="Step 2.3 : Recalculate MVP Mandays",
|
| 923 |
-
ui={
|
| 924 |
-
"generated_MVP_mandays_prompt_editor": UIConfig(
|
| 925 |
-
component_type=UIComponentType.TEXTBOX,
|
| 926 |
-
label="MVP Mandays Formatting System Prompt",
|
| 927 |
-
lines=20,
|
| 928 |
-
interactive=True
|
| 929 |
-
),
|
| 930 |
-
"generated_MVP_mandays_dataframe": UIConfig(
|
| 931 |
-
component_type=UIComponentType.DATAFRAME,
|
| 932 |
-
label="Formatted MVP Mandays",
|
| 933 |
-
interactive=True,
|
| 934 |
-
)
|
| 935 |
-
}
|
| 936 |
-
),
|
| 937 |
-
}
|
| 938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
prompt_configs.py
CHANGED
|
@@ -39,6 +39,100 @@ class PromptConfig:
|
|
| 39 |
#################################################################################################################################################
|
| 40 |
|
| 41 |
PROMPTS = {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
"client_initial_question": PromptConfig(
|
| 43 |
prompt=
|
| 44 |
"""
|
|
@@ -115,7 +209,7 @@ PROMPTS = {
|
|
| 115 |
inputs=["project_detail"],
|
| 116 |
outputs=["follow_up_questions"],
|
| 117 |
model=ModelType.O1_MINI,
|
| 118 |
-
description="Generate
|
| 119 |
step="Chatbot Prompt Editors",
|
| 120 |
ui={
|
| 121 |
"client_follow_up_prompt_editor": UIConfig(
|
|
@@ -152,14 +246,14 @@ PROMPTS = {
|
|
| 152 |
Just return the string text and NOTHING else, omit code guards.
|
| 153 |
""",
|
| 154 |
inputs=["project_detail", "requirements_rubric"],
|
| 155 |
-
outputs=["
|
| 156 |
model=ModelType.O1_MINI,
|
| 157 |
-
description="Generate
|
| 158 |
step="Chatbot Prompt Editors",
|
| 159 |
ui={
|
| 160 |
-
"
|
| 161 |
component_type=UIComponentType.TEXTBOX,
|
| 162 |
-
label="
|
| 163 |
lines=20,
|
| 164 |
interactive=True,
|
| 165 |
)
|
|
@@ -215,14 +309,14 @@ PROMPTS = {
|
|
| 215 |
Only provide the list of formatted questions without any additional introduction or summary.
|
| 216 |
""",
|
| 217 |
inputs=['project_detail'],
|
| 218 |
-
outputs=['
|
| 219 |
model=ModelType.O1_MINI,
|
| 220 |
-
description="Generate Context-Aware List Of Questions",
|
| 221 |
step="Chatbot Prompt Editors",
|
| 222 |
ui={
|
| 223 |
-
"
|
| 224 |
component_type=UIComponentType.TEXTBOX,
|
| 225 |
-
label="
|
| 226 |
lines=20,
|
| 227 |
interactive=True
|
| 228 |
)
|
|
@@ -250,14 +344,14 @@ PROMPTS = {
|
|
| 250 |
Just return the generated list of follow up questions as string and nothing else.
|
| 251 |
""",
|
| 252 |
inputs=["project_detail"],
|
| 253 |
-
outputs=["
|
| 254 |
model=ModelType.O1_MINI,
|
| 255 |
-
description="Generate
|
| 256 |
step="Chatbot Prompt Editors",
|
| 257 |
ui={
|
| 258 |
-
"
|
| 259 |
component_type=UIComponentType.TEXTBOX,
|
| 260 |
-
label="
|
| 261 |
lines=20,
|
| 262 |
interactive=True
|
| 263 |
)
|
|
@@ -280,20 +374,21 @@ PROMPTS = {
|
|
| 280 |
Just return the formatted list as string and nothing else.
|
| 281 |
""",
|
| 282 |
inputs=['project_detail'],
|
| 283 |
-
outputs=['
|
| 284 |
model=ModelType.O1_MINI,
|
| 285 |
-
description="
|
| 286 |
step="Chatbot Prompt Editors",
|
| 287 |
ui={
|
| 288 |
-
"
|
| 289 |
component_type=UIComponentType.TEXTBOX,
|
| 290 |
-
label="
|
| 291 |
lines=20,
|
| 292 |
interactive=True
|
| 293 |
)
|
| 294 |
}
|
| 295 |
),
|
| 296 |
|
|
|
|
| 297 |
"generate_prd": PromptConfig(
|
| 298 |
prompt=
|
| 299 |
"""
|
|
@@ -303,11 +398,18 @@ PROMPTS = {
|
|
| 303 |
Do not also exclude any input provided.
|
| 304 |
Structure the document to ensure clarity and logical flow.
|
| 305 |
Make sure to make the title "Project Requirements".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
""",
|
| 307 |
inputs=["project_detail"],
|
| 308 |
outputs=["generated_prd"],
|
| 309 |
model=ModelType.O1_MINI,
|
| 310 |
-
description="
|
| 311 |
step="Step 1 : Scope & Components",
|
| 312 |
ui={
|
| 313 |
"requirement_prompt_editor": UIConfig(
|
|
@@ -360,7 +462,7 @@ PROMPTS = {
|
|
| 360 |
inputs=["generated_prd"],
|
| 361 |
outputs=["generated_intent_list"],
|
| 362 |
model=ModelType.O1_MINI,
|
| 363 |
-
description="
|
| 364 |
step="Step 1 : Scope & Components",
|
| 365 |
ui={
|
| 366 |
"intent_list_prompt_editor": UIConfig(
|
|
@@ -384,7 +486,7 @@ PROMPTS = {
|
|
| 384 |
}
|
| 385 |
),
|
| 386 |
|
| 387 |
-
"
|
| 388 |
prompt=
|
| 389 |
"""
|
| 390 |
Context:
|
|
@@ -399,6 +501,11 @@ PROMPTS = {
|
|
| 399 |
For each phase, include project-specific components that align with the goal of developing the software Project. Break down each phase into granular sub-components, ensuring specificity and alignment with the PRD.
|
| 400 |
Use the PRD to extract relevant, granular components that reflect deliverables unique to this project.
|
| 401 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
Output Format:
|
| 403 |
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 404 |
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
|
@@ -406,7 +513,7 @@ PROMPTS = {
|
|
| 406 |
inputs=["generated_prd"],
|
| 407 |
outputs=["generated_plan_test_components"],
|
| 408 |
model=ModelType.O1_MINI,
|
| 409 |
-
description="
|
| 410 |
step="Step 1 : Scope & Components",
|
| 411 |
ui={
|
| 412 |
"plan_test_component_prompt_editor": UIConfig(
|
|
@@ -430,6 +537,7 @@ PROMPTS = {
|
|
| 430 |
}
|
| 431 |
),
|
| 432 |
|
|
|
|
| 433 |
"generate_engage_plan_test_components": PromptConfig(
|
| 434 |
prompt=
|
| 435 |
"""
|
|
@@ -460,7 +568,7 @@ PROMPTS = {
|
|
| 460 |
inputs=["generated_prd"],
|
| 461 |
outputs=["generated_plan_test_components"],
|
| 462 |
model=ModelType.O1_MINI,
|
| 463 |
-
description="
|
| 464 |
step="Step 1 : Scope & Components",
|
| 465 |
ui={
|
| 466 |
"plan_test_prompt_editor": UIConfig(
|
|
@@ -528,7 +636,7 @@ PROMPTS = {
|
|
| 528 |
inputs=["generated_prd"],
|
| 529 |
outputs=["generated_dev_components"],
|
| 530 |
model=ModelType.O1_MINI,
|
| 531 |
-
description="
|
| 532 |
step="Step 1 : Scope & Components",
|
| 533 |
ui={
|
| 534 |
"dev_component_prompt_editor": UIConfig(
|
|
@@ -620,7 +728,7 @@ PROMPTS = {
|
|
| 620 |
inputs=["generated_prd" , "generated_intent_list"],
|
| 621 |
outputs=["generated_dev_components"],
|
| 622 |
model=ModelType.O1_MINI,
|
| 623 |
-
description="
|
| 624 |
step="Step 1 : Scope & Components",
|
| 625 |
ui={
|
| 626 |
"dev_component_prompt_editor": UIConfig(
|
|
@@ -686,7 +794,7 @@ PROMPTS = {
|
|
| 686 |
inputs=["generated_dev_components"],
|
| 687 |
outputs=["reformatted_dev_components"],
|
| 688 |
model=ModelType.O1_MINI,
|
| 689 |
-
description="
|
| 690 |
step="Step 1 : Scope & Components",
|
| 691 |
ui={
|
| 692 |
"reformatted_dev_components_prompt_editor": UIConfig(
|
|
@@ -766,7 +874,7 @@ PROMPTS = {
|
|
| 766 |
inputs=["generated_dev_components"],
|
| 767 |
outputs=["reformatted_dev_components"],
|
| 768 |
model=ModelType.O1_MINI,
|
| 769 |
-
description="
|
| 770 |
step="Step 1 : Scope & Components",
|
| 771 |
ui={
|
| 772 |
"reformatted_dev_components_prompt_editor": UIConfig(
|
|
|
|
| 39 |
#################################################################################################################################################
|
| 40 |
|
| 41 |
PROMPTS = {
|
| 42 |
+
"component_agent": PromptConfig(
|
| 43 |
+
prompt=
|
| 44 |
+
"""
|
| 45 |
+
You are an AI that analyzes a software project’s requirements and determines all possible valid and unique configurations based on the provided constraints.
|
| 46 |
+
|
| 47 |
+
Input Data:
|
| 48 |
+
|
| 49 |
+
- Project Requirement Document (PRD) – Describes the project’s goals and scope.
|
| 50 |
+
- List of Functions – A predefined set of function names and descriptions. STRICTLY use these ONLY (do not create new functions).
|
| 51 |
+
|
| 52 |
+
Objective:
|
| 53 |
+
Identify and classify valid project configurations into one of the following categories:
|
| 54 |
+
|
| 55 |
+
- Hybrid Configurations – If the project requires both chatbot and document extraction functionalities.
|
| 56 |
+
- Chatbot-Only Configurations – If the project is focused solely on chatbot functionality.
|
| 57 |
+
- Document Extraction-Only Configurations – If the project involves document extraction but does not require chatbot features.
|
| 58 |
+
|
| 59 |
+
Rules for Ensuring Uniqueness:
|
| 60 |
+
|
| 61 |
+
- Each configuration must belong to only one category (Chatbot, Document Extraction, or Hybrid) and be sorted by best match to the project requirements.
|
| 62 |
+
- Avoid redundant permutations – Ensure no duplicate function combinations under different names.
|
| 63 |
+
- Do NOT create new functions – Use only those from the provided function list.
|
| 64 |
+
|
| 65 |
+
Expected Output Format:
|
| 66 |
+
|
| 67 |
+
- A structured JSON object with no duplicate function combinations.
|
| 68 |
+
- DO NOT include any code guards or placeholders.
|
| 69 |
+
|
| 70 |
+
Example 1:
|
| 71 |
+
Project Requirement:
|
| 72 |
+
"The system must provide a chatbot to handle customer queries. It should support intent recognition and predefined workflows. The chatbot must work across web, mobile, and messaging platforms and escalate complex queries to human agents when needed."
|
| 73 |
+
|
| 74 |
+
OUTPUT:
|
| 75 |
+
[
|
| 76 |
+
{
|
| 77 |
+
"configuration_type": "Basic Chatbot",
|
| 78 |
+
"selected_functions": [
|
| 79 |
+
"generate_plan_test_components",
|
| 80 |
+
"generate_intent_list",
|
| 81 |
+
"generate_engage_dev_components"
|
| 82 |
+
]
|
| 83 |
+
}
|
| 84 |
+
]
|
| 85 |
+
|
| 86 |
+
Example 2:
|
| 87 |
+
Project Requirement:
|
| 88 |
+
"The system must extract structured data from PDFs. It should identify key fields, validate extracted data, support batch processing, and integrate with our existing software."
|
| 89 |
+
|
| 90 |
+
OUTPUT:
|
| 91 |
+
[
|
| 92 |
+
{
|
| 93 |
+
"configuration_type": "Basic Document Extraction",
|
| 94 |
+
"selected_functions": [
|
| 95 |
+
"generate_plan_test_components",
|
| 96 |
+
"generate_page_dev_components"
|
| 97 |
+
]
|
| 98 |
+
}
|
| 99 |
+
]
|
| 100 |
+
|
| 101 |
+
Example 3:
|
| 102 |
+
Project Requirement:
|
| 103 |
+
"The system must integrate a chatbot with document extraction. The chatbot should accept user-uploaded documents, extract relevant data, and respond based on extracted content."
|
| 104 |
+
|
| 105 |
+
OUTPUT:
|
| 106 |
+
[
|
| 107 |
+
{
|
| 108 |
+
"configuration_type": "Basic Chatbot and Document Extraction",
|
| 109 |
+
"selected_functions": [
|
| 110 |
+
"generate_plan_test_components",
|
| 111 |
+
"generate_intent_list",
|
| 112 |
+
"generate_page_dev_components",
|
| 113 |
+
"generate_engage_dev_components"
|
| 114 |
+
]
|
| 115 |
+
}
|
| 116 |
+
]
|
| 117 |
+
|
| 118 |
+
<List of Functions: ONLY use these>
|
| 119 |
+
generate_plan_test_components: For ALL projects, generates a granular component list for the Planning and Testing phases,while explicitly excluding development-related tasks.
|
| 120 |
+
|
| 121 |
+
generate_page_dev_components: For document extraction projects, produces a structured development component breakdown, categorizing frontend, backend, and integration tasks, while addressing edge cases and special considerations.
|
| 122 |
+
|
| 123 |
+
generate_intent_list: For chatbot projects, analyzes a project’s requirements to define all possible chatbot intents and workflows, categorizing them by complexity (simple, multi-step, fallback, etc.) while also identifying overlooked but industry-relevant intents based on competitor comparisons.
|
| 124 |
+
|
| 125 |
+
generate_engage_dev_components: For chatbot projects, extracts comprehensive development components from the Project Requirement Document (PRD) and Chatbot Intent List (CIL), translating intents, workflows, and fallback scenarios into specific technical deliverables for structured implementation.
|
| 126 |
+
|
| 127 |
+
<Requirements>
|
| 128 |
+
""",
|
| 129 |
+
inputs=['generated_prd'],
|
| 130 |
+
outputs=["configuration_type"],
|
| 131 |
+
step="Analyze Configuration Type",
|
| 132 |
+
model=ModelType.O1_MINI,
|
| 133 |
+
description="Component Agent",
|
| 134 |
+
),
|
| 135 |
+
|
| 136 |
"client_initial_question": PromptConfig(
|
| 137 |
prompt=
|
| 138 |
"""
|
|
|
|
| 209 |
inputs=["project_detail"],
|
| 210 |
outputs=["follow_up_questions"],
|
| 211 |
model=ModelType.O1_MINI,
|
| 212 |
+
description="Generate Client Follow Up Questions",
|
| 213 |
step="Chatbot Prompt Editors",
|
| 214 |
ui={
|
| 215 |
"client_follow_up_prompt_editor": UIConfig(
|
|
|
|
| 246 |
Just return the string text and NOTHING else, omit code guards.
|
| 247 |
""",
|
| 248 |
inputs=["project_detail", "requirements_rubric"],
|
| 249 |
+
outputs=["generated_engage_follow_up_questions"],
|
| 250 |
model=ModelType.O1_MINI,
|
| 251 |
+
description="Generate Engage Context-Aware List Of Questions",
|
| 252 |
step="Chatbot Prompt Editors",
|
| 253 |
ui={
|
| 254 |
+
"engage_follow_up_prompt_editor": UIConfig(
|
| 255 |
component_type=UIComponentType.TEXTBOX,
|
| 256 |
+
label="Engage Follow Up Questions Prompt",
|
| 257 |
lines=20,
|
| 258 |
interactive=True,
|
| 259 |
)
|
|
|
|
| 309 |
Only provide the list of formatted questions without any additional introduction or summary.
|
| 310 |
""",
|
| 311 |
inputs=['project_detail'],
|
| 312 |
+
outputs=['generated_page_follow_up_questions'],
|
| 313 |
model=ModelType.O1_MINI,
|
| 314 |
+
description="Generate Page Context-Aware List Of Questions",
|
| 315 |
step="Chatbot Prompt Editors",
|
| 316 |
ui={
|
| 317 |
+
"page_follow_up_prompt_editor": UIConfig(
|
| 318 |
component_type=UIComponentType.TEXTBOX,
|
| 319 |
+
label="Page Follow Up Questions Prompt",
|
| 320 |
lines=20,
|
| 321 |
interactive=True
|
| 322 |
)
|
|
|
|
| 344 |
Just return the generated list of follow up questions as string and nothing else.
|
| 345 |
""",
|
| 346 |
inputs=["project_detail"],
|
| 347 |
+
outputs=["generated_engage_further_follow_up_questions"],
|
| 348 |
model=ModelType.O1_MINI,
|
| 349 |
+
description="Generate Engage Further Follow Up Questions",
|
| 350 |
step="Chatbot Prompt Editors",
|
| 351 |
ui={
|
| 352 |
+
"engage_further_follow_up_prompt_editor": UIConfig(
|
| 353 |
component_type=UIComponentType.TEXTBOX,
|
| 354 |
+
label="Engage Further Follow Up Questions Prompt",
|
| 355 |
lines=20,
|
| 356 |
interactive=True
|
| 357 |
)
|
|
|
|
| 374 |
Just return the formatted list as string and nothing else.
|
| 375 |
""",
|
| 376 |
inputs=['project_detail'],
|
| 377 |
+
outputs=['generated_page_further_follow_up_questions'],
|
| 378 |
model=ModelType.O1_MINI,
|
| 379 |
+
description="Generate Page Further Follow Up Questions",
|
| 380 |
step="Chatbot Prompt Editors",
|
| 381 |
ui={
|
| 382 |
+
"page_further_follow_up_prompt_editor": UIConfig(
|
| 383 |
component_type=UIComponentType.TEXTBOX,
|
| 384 |
+
label="Page Further Follow Up Questions Prompt",
|
| 385 |
lines=20,
|
| 386 |
interactive=True
|
| 387 |
)
|
| 388 |
}
|
| 389 |
),
|
| 390 |
|
| 391 |
+
#########################################################################################
|
| 392 |
"generate_prd": PromptConfig(
|
| 393 |
prompt=
|
| 394 |
"""
|
|
|
|
| 398 |
Do not also exclude any input provided.
|
| 399 |
Structure the document to ensure clarity and logical flow.
|
| 400 |
Make sure to make the title "Project Requirements".
|
| 401 |
+
|
| 402 |
+
Return a JSON object with TWO keys, in the following structure:
|
| 403 |
+
|
| 404 |
+
{
|
| 405 |
+
"detailed_breakdown": "A well-structured, logically ordered breakdown of the input, ensuring clarity while preserving all details.",
|
| 406 |
+
"summary": "A concise summary capturing key points, timeline, budget constraints, and objectives."
|
| 407 |
+
}
|
| 408 |
""",
|
| 409 |
inputs=["project_detail"],
|
| 410 |
outputs=["generated_prd"],
|
| 411 |
model=ModelType.O1_MINI,
|
| 412 |
+
description="Generate Project Requirements Document (PRD)",
|
| 413 |
step="Step 1 : Scope & Components",
|
| 414 |
ui={
|
| 415 |
"requirement_prompt_editor": UIConfig(
|
|
|
|
| 462 |
inputs=["generated_prd"],
|
| 463 |
outputs=["generated_intent_list"],
|
| 464 |
model=ModelType.O1_MINI,
|
| 465 |
+
description="Generate Intent List",
|
| 466 |
step="Step 1 : Scope & Components",
|
| 467 |
ui={
|
| 468 |
"intent_list_prompt_editor": UIConfig(
|
|
|
|
| 486 |
}
|
| 487 |
),
|
| 488 |
|
| 489 |
+
"generate_plan_test_components": PromptConfig(
|
| 490 |
prompt=
|
| 491 |
"""
|
| 492 |
Context:
|
|
|
|
| 501 |
For each phase, include project-specific components that align with the goal of developing the software Project. Break down each phase into granular sub-components, ensuring specificity and alignment with the PRD.
|
| 502 |
Use the PRD to extract relevant, granular components that reflect deliverables unique to this project.
|
| 503 |
|
| 504 |
+
Tech Stack:
|
| 505 |
+
Backend: FastAPI, Python
|
| 506 |
+
Chatbot: Chatbot Builder , COZE , Yellow.ai
|
| 507 |
+
Infrastructure: AWS, PostgreSQL, Redis, Docker, Alembic
|
| 508 |
+
|
| 509 |
Output Format:
|
| 510 |
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 511 |
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
|
|
|
| 513 |
inputs=["generated_prd"],
|
| 514 |
outputs=["generated_plan_test_components"],
|
| 515 |
model=ModelType.O1_MINI,
|
| 516 |
+
description="Generate planning and testing components",
|
| 517 |
step="Step 1 : Scope & Components",
|
| 518 |
ui={
|
| 519 |
"plan_test_component_prompt_editor": UIConfig(
|
|
|
|
| 537 |
}
|
| 538 |
),
|
| 539 |
|
| 540 |
+
#IGNORE FIRST
|
| 541 |
"generate_engage_plan_test_components": PromptConfig(
|
| 542 |
prompt=
|
| 543 |
"""
|
|
|
|
| 568 |
inputs=["generated_prd"],
|
| 569 |
outputs=["generated_plan_test_components"],
|
| 570 |
model=ModelType.O1_MINI,
|
| 571 |
+
description="Generate planning and testing components",
|
| 572 |
step="Step 1 : Scope & Components",
|
| 573 |
ui={
|
| 574 |
"plan_test_prompt_editor": UIConfig(
|
|
|
|
| 636 |
inputs=["generated_prd"],
|
| 637 |
outputs=["generated_dev_components"],
|
| 638 |
model=ModelType.O1_MINI,
|
| 639 |
+
description="Generate development components",
|
| 640 |
step="Step 1 : Scope & Components",
|
| 641 |
ui={
|
| 642 |
"dev_component_prompt_editor": UIConfig(
|
|
|
|
| 728 |
inputs=["generated_prd" , "generated_intent_list"],
|
| 729 |
outputs=["generated_dev_components"],
|
| 730 |
model=ModelType.O1_MINI,
|
| 731 |
+
description="Generate development components",
|
| 732 |
step="Step 1 : Scope & Components",
|
| 733 |
ui={
|
| 734 |
"dev_component_prompt_editor": UIConfig(
|
|
|
|
| 794 |
inputs=["generated_dev_components"],
|
| 795 |
outputs=["reformatted_dev_components"],
|
| 796 |
model=ModelType.O1_MINI,
|
| 797 |
+
description="Reformat development components",
|
| 798 |
step="Step 1 : Scope & Components",
|
| 799 |
ui={
|
| 800 |
"reformatted_dev_components_prompt_editor": UIConfig(
|
|
|
|
| 874 |
inputs=["generated_dev_components"],
|
| 875 |
outputs=["reformatted_dev_components"],
|
| 876 |
model=ModelType.O1_MINI,
|
| 877 |
+
description="Reformat development components",
|
| 878 |
step="Step 1 : Scope & Components",
|
| 879 |
ui={
|
| 880 |
"reformatted_dev_components_prompt_editor": UIConfig(
|