Spaces:
Runtime error
Runtime error
ICAS03 commited on
Commit ·
e832fd0
1
Parent(s): 10e3478
- Fix Notion Integration
Browse files- Fix dev_component prompt
- Added reformat dev component
- Project.py +19 -65
- app.py +155 -91
- event_handlers.py +31 -9
- google_drive.py +39 -11
- notion.py +72 -29
- page_prompts_config.py +361 -335
Project.py
CHANGED
|
@@ -67,6 +67,7 @@ class Project:
|
|
| 67 |
'component_list': lambda self: self.component_list,
|
| 68 |
'generated_plan_test_components': lambda self: self.generated_plan_test_components,
|
| 69 |
'generated_dev_components': lambda self: self.generated_dev_components,
|
|
|
|
| 70 |
'generated_plan_test_mandays': lambda self: self.plan_test_mandays,
|
| 71 |
'generated_dev_mandays': lambda self: self.dev_mandays,
|
| 72 |
'quotation_cost': lambda self: self.quotation_cost,
|
|
@@ -190,12 +191,20 @@ class Project:
|
|
| 190 |
)
|
| 191 |
|
| 192 |
progress(0.7, desc="Progress 3: Generating Development Components...")
|
| 193 |
-
dev_component_list = self.execute_prompt(
|
| 194 |
"generate_dev_components",
|
| 195 |
{
|
| 196 |
"generated_prd": self.generated_prd
|
| 197 |
}
|
| 198 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
progress(1.0, desc="Complete!")
|
| 201 |
return [
|
|
@@ -203,14 +212,16 @@ class Project:
|
|
| 203 |
self.generated_prd,
|
| 204 |
plan_test_component_list,
|
| 205 |
plan_test_component_list,
|
| 206 |
-
dev_component_list,
|
| 207 |
-
dev_component_list,
|
|
|
|
|
|
|
| 208 |
"Generated PRD and Component List! Click Generate Final Quotation To Generate Quotation"
|
| 209 |
]
|
| 210 |
|
| 211 |
def generate_mandays_and_quotation(self, plan_test_component, dev_component, progress=gr.Progress()):
|
| 212 |
self.generated_plan_test_components = plan_test_component
|
| 213 |
-
self.
|
| 214 |
|
| 215 |
# Generate Plan & Test Mandays
|
| 216 |
progress(0.2, desc="Progress 1: Generating Mandays for Plan & Test Components...")
|
|
@@ -226,7 +237,7 @@ class Project:
|
|
| 226 |
self.dev_mandays = self.execute_prompt(
|
| 227 |
"generate_dev_mandays",
|
| 228 |
{
|
| 229 |
-
"
|
| 230 |
}
|
| 231 |
)
|
| 232 |
|
|
@@ -376,7 +387,7 @@ class Project:
|
|
| 376 |
|
| 377 |
def generate_sow(self, generated_prd, plan_test_component, dev_component, cost, progress=gr.Progress()):
|
| 378 |
self.generated_plan_test_components = plan_test_component
|
| 379 |
-
self.
|
| 380 |
self.quotation_cost = cost
|
| 381 |
|
| 382 |
# Generate general SOW
|
|
@@ -386,7 +397,7 @@ class Project:
|
|
| 386 |
{
|
| 387 |
"generated_prd": generated_prd,
|
| 388 |
"generated_plan_test_components": plan_test_component,
|
| 389 |
-
"
|
| 390 |
"quotation_cost": cost
|
| 391 |
}
|
| 392 |
)
|
|
@@ -397,7 +408,7 @@ class Project:
|
|
| 397 |
"generate_Tech_SOW",
|
| 398 |
{
|
| 399 |
"generated_plan_test_components": plan_test_component,
|
| 400 |
-
"
|
| 401 |
}
|
| 402 |
)
|
| 403 |
|
|
@@ -449,60 +460,3 @@ class Project:
|
|
| 449 |
error_message = f"Error recalculating costs: {str(e)}"
|
| 450 |
return error_message, error_message
|
| 451 |
|
| 452 |
-
def update_display_mode(mode, content):
|
| 453 |
-
if mode == "Textbox":
|
| 454 |
-
return gr.update(visible=True, value=content), gr.update(visible=False, value=content)
|
| 455 |
-
else:
|
| 456 |
-
return gr.update(visible=False, value=content), gr.update(visible=True, value=content)
|
| 457 |
-
|
| 458 |
-
# Updates system prompts in both runtime PROMPTS dictionary and config file
|
| 459 |
-
def update_system_prompts(new_prompt: str, prompt_name: str) -> str:
|
| 460 |
-
"""Update system prompts in both runtime PROMPTS dictionary and config file"""
|
| 461 |
-
try:
|
| 462 |
-
# Remove triple quotes and normalize whitespace
|
| 463 |
-
new_prompt = new_prompt.strip('"""').strip()
|
| 464 |
-
|
| 465 |
-
if prompt_name not in PROMPTS:
|
| 466 |
-
return f"❌ Error: Unknown prompt name '{prompt_name}'"
|
| 467 |
-
|
| 468 |
-
# Debug print statements
|
| 469 |
-
print("\nDEBUG - update_system_prompts:")
|
| 470 |
-
print(f"Prompt name: {prompt_name}")
|
| 471 |
-
print(f"New prompt length: {len(new_prompt)}")
|
| 472 |
-
print(f"Original prompt length: {len(PROMPTS[prompt_name].prompt)}")
|
| 473 |
-
print("\nFirst 100 chars of new prompt:")
|
| 474 |
-
print(new_prompt[:100])
|
| 475 |
-
print("\nFirst 100 chars of original prompt:")
|
| 476 |
-
print(PROMPTS[prompt_name].prompt[:100])
|
| 477 |
-
|
| 478 |
-
# Update the prompt in the runtime PROMPTS dictionary
|
| 479 |
-
PROMPTS[prompt_name].prompt = new_prompt
|
| 480 |
-
|
| 481 |
-
# Update the physical config file
|
| 482 |
-
config_path = "page_prompts_config.py"
|
| 483 |
-
with open(config_path, 'r') as file:
|
| 484 |
-
content = file.read()
|
| 485 |
-
|
| 486 |
-
# Find the specific PromptConfig for the given prompt_name
|
| 487 |
-
pattern = fr'"{prompt_name}":\s*PromptConfig\(\s*prompt=\s*"""[\s\S]*?"""'
|
| 488 |
-
|
| 489 |
-
# Format the new prompt with proper indentation
|
| 490 |
-
formatted_prompt = "\n".join(
|
| 491 |
-
" " + line if line.strip() else line
|
| 492 |
-
for line in new_prompt.split("\n")
|
| 493 |
-
)
|
| 494 |
-
|
| 495 |
-
replacement = f'"{prompt_name}": PromptConfig(\n prompt=\n """\n{formatted_prompt}\n """'
|
| 496 |
-
|
| 497 |
-
updated_content = re.sub(pattern, replacement, content)
|
| 498 |
-
|
| 499 |
-
# Write back to file
|
| 500 |
-
with open(config_path, 'w') as file:
|
| 501 |
-
file.write(updated_content)
|
| 502 |
-
|
| 503 |
-
return "✅ Successfully updated prompt"
|
| 504 |
-
|
| 505 |
-
except Exception as e:
|
| 506 |
-
print(f"Exception in update_system_prompts: {str(e)}")
|
| 507 |
-
return f"❌ Error updating prompt: {str(e)}"
|
| 508 |
-
|
|
|
|
| 67 |
'component_list': lambda self: self.component_list,
|
| 68 |
'generated_plan_test_components': lambda self: self.generated_plan_test_components,
|
| 69 |
'generated_dev_components': lambda self: self.generated_dev_components,
|
| 70 |
+
'reformatted_dev_components': lambda self: self.reformatted_dev_components,
|
| 71 |
'generated_plan_test_mandays': lambda self: self.plan_test_mandays,
|
| 72 |
'generated_dev_mandays': lambda self: self.dev_mandays,
|
| 73 |
'quotation_cost': lambda self: self.quotation_cost,
|
|
|
|
| 191 |
)
|
| 192 |
|
| 193 |
progress(0.7, desc="Progress 3: Generating Development Components...")
|
| 194 |
+
self.dev_component_list = self.execute_prompt(
|
| 195 |
"generate_dev_components",
|
| 196 |
{
|
| 197 |
"generated_prd": self.generated_prd
|
| 198 |
}
|
| 199 |
)
|
| 200 |
+
|
| 201 |
+
progress(0.8, desc="Progress 4: Reformatting Development Components...")
|
| 202 |
+
reformatted_dev_component_list = self.execute_prompt(
|
| 203 |
+
"reformat_dev_components",
|
| 204 |
+
{
|
| 205 |
+
"generated_dev_components": self.dev_component_list
|
| 206 |
+
}
|
| 207 |
+
)
|
| 208 |
|
| 209 |
progress(1.0, desc="Complete!")
|
| 210 |
return [
|
|
|
|
| 212 |
self.generated_prd,
|
| 213 |
plan_test_component_list,
|
| 214 |
plan_test_component_list,
|
| 215 |
+
self.dev_component_list,
|
| 216 |
+
self.dev_component_list,
|
| 217 |
+
reformatted_dev_component_list,
|
| 218 |
+
reformatted_dev_component_list,
|
| 219 |
"Generated PRD and Component List! Click Generate Final Quotation To Generate Quotation"
|
| 220 |
]
|
| 221 |
|
| 222 |
def generate_mandays_and_quotation(self, plan_test_component, dev_component, progress=gr.Progress()):
|
| 223 |
self.generated_plan_test_components = plan_test_component
|
| 224 |
+
self.reformatted_dev_components = dev_component
|
| 225 |
|
| 226 |
# Generate Plan & Test Mandays
|
| 227 |
progress(0.2, desc="Progress 1: Generating Mandays for Plan & Test Components...")
|
|
|
|
| 237 |
self.dev_mandays = self.execute_prompt(
|
| 238 |
"generate_dev_mandays",
|
| 239 |
{
|
| 240 |
+
"reformatted_dev_components": dev_component
|
| 241 |
}
|
| 242 |
)
|
| 243 |
|
|
|
|
| 387 |
|
| 388 |
def generate_sow(self, generated_prd, plan_test_component, dev_component, cost, progress=gr.Progress()):
|
| 389 |
self.generated_plan_test_components = plan_test_component
|
| 390 |
+
self.reformatted_dev_components = dev_component
|
| 391 |
self.quotation_cost = cost
|
| 392 |
|
| 393 |
# Generate general SOW
|
|
|
|
| 397 |
{
|
| 398 |
"generated_prd": generated_prd,
|
| 399 |
"generated_plan_test_components": plan_test_component,
|
| 400 |
+
"reformatted_dev_components": dev_component,
|
| 401 |
"quotation_cost": cost
|
| 402 |
}
|
| 403 |
)
|
|
|
|
| 408 |
"generate_Tech_SOW",
|
| 409 |
{
|
| 410 |
"generated_plan_test_components": plan_test_component,
|
| 411 |
+
"reformatted_dev_components": dev_component
|
| 412 |
}
|
| 413 |
)
|
| 414 |
|
|
|
|
| 460 |
error_message = f"Error recalculating costs: {str(e)}"
|
| 461 |
return error_message, error_message
|
| 462 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.py
CHANGED
|
@@ -7,7 +7,6 @@ from notion import *
|
|
| 7 |
from state import state
|
| 8 |
from page_prompts_config import PROMPTS, ModelType, UIComponentType, UIConfig, PromptConfig
|
| 9 |
from typing import Dict, Any, Tuple
|
| 10 |
-
from Project import update_system_prompts
|
| 11 |
import pandas as pd
|
| 12 |
from io import StringIO
|
| 13 |
from event_handlers import setup_all_handlers
|
|
@@ -35,44 +34,120 @@ def create_ui_component(config: UIConfig, prompt: str = None) -> Any:
|
|
| 35 |
interactive=config.interactive,
|
| 36 |
visible=config.visible
|
| 37 |
)
|
| 38 |
-
elif config.component_type == UIComponentType.RADIO:
|
| 39 |
-
return gr.Radio(
|
| 40 |
-
choices=["Textbox", "Markdown"],
|
| 41 |
-
value="Textbox",
|
| 42 |
-
label="Select Mode",
|
| 43 |
-
interactive=True,
|
| 44 |
-
container=False,
|
| 45 |
-
elem_classes=["radio-group-horizontal"]
|
| 46 |
-
)
|
| 47 |
return None
|
| 48 |
|
| 49 |
def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
| 50 |
components = {}
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 76 |
# Create output components in two columns
|
| 77 |
with gr.Row():
|
| 78 |
text_key = next((k for k in prompt_config.ui.keys() if k.endswith('_text')), None)
|
|
@@ -81,18 +156,33 @@ def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
|
| 81 |
if text_key and markdown_key:
|
| 82 |
# Left column for textbox
|
| 83 |
with gr.Column(scale=1):
|
| 84 |
-
|
| 85 |
prompt_config.ui[text_key]
|
| 86 |
)
|
|
|
|
|
|
|
|
|
|
| 87 |
# Right column for markdown
|
| 88 |
with gr.Column(scale=1):
|
| 89 |
-
|
| 90 |
prompt_config.ui[markdown_key]
|
| 91 |
)
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
|
| 97 |
return components
|
| 98 |
|
|
@@ -107,9 +197,9 @@ def create_quotation_generator_section():
|
|
| 107 |
gr.Markdown("## ⚠️ Instructions #2")
|
| 108 |
for instruction in [
|
| 109 |
"1. **Edit System Prompt**: Edit the system's prompt as you wish.",
|
| 110 |
-
"2. **
|
| 111 |
-
"3. **
|
| 112 |
-
"4. **
|
| 113 |
]:
|
| 114 |
gr.Markdown(instruction)
|
| 115 |
|
|
@@ -118,10 +208,11 @@ def create_quotation_generator_section():
|
|
| 118 |
|
| 119 |
with gr.Row():
|
| 120 |
with gr.Column(scale=4):
|
| 121 |
-
save_prompts_btn = gr.Button("💾 Save System Prompt")
|
| 122 |
-
|
| 123 |
prompt_steps = {}
|
| 124 |
for prompt_key, prompt_config in PROMPTS.items():
|
|
|
|
|
|
|
|
|
|
| 125 |
step = prompt_config.step
|
| 126 |
if step and step.strip():
|
| 127 |
if step not in prompt_steps:
|
|
@@ -176,7 +267,7 @@ def create_quotation_generator_section():
|
|
| 176 |
page_upload_notion_btn = gr.Button(" Upload to Notion")
|
| 177 |
|
| 178 |
|
| 179 |
-
return (all_components, step_buttons,
|
| 180 |
page_progress_update, page_upload_drive_btn, page_upload_notion_btn,
|
| 181 |
quotation_cost, page_recalc_btn, page_notes_box, page_save_quotation_btn , drive_folder_name)
|
| 182 |
|
|
@@ -186,35 +277,6 @@ def update_display_mode(mode: str, text_content: str) -> tuple:
|
|
| 186 |
gr.update(visible=(mode == "Markdown"), value=text_content)
|
| 187 |
)
|
| 188 |
|
| 189 |
-
def save_all_prompts(*prompts):
|
| 190 |
-
prompt_names = [
|
| 191 |
-
name for name, config in PROMPTS.items()
|
| 192 |
-
if config.ui and any(key.endswith('_prompt_editor') for key in config.ui.keys())
|
| 193 |
-
]
|
| 194 |
-
|
| 195 |
-
updated_prompts = []
|
| 196 |
-
for i, (prompt, name) in enumerate(zip(prompts, prompt_names)):
|
| 197 |
-
print(f"\nChecking prompt {i+1}/{len(prompt_names)}: {name}")
|
| 198 |
-
if not prompt:
|
| 199 |
-
print(f"Skipping {name} - empty prompt")
|
| 200 |
-
continue
|
| 201 |
-
|
| 202 |
-
# Clean both prompts more thoroughly
|
| 203 |
-
cleaned_prompt = prompt.strip().strip('"""').strip()
|
| 204 |
-
original_prompt = PROMPTS[name].prompt.strip()
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
if cleaned_prompt != original_prompt:
|
| 208 |
-
print(f"Updating prompt for {name}")
|
| 209 |
-
result = update_system_prompts(cleaned_prompt, name)
|
| 210 |
-
print(f"Update result: {result}")
|
| 211 |
-
updated_prompts.append(name)
|
| 212 |
-
else:
|
| 213 |
-
print(f"No changes detected for {name}")
|
| 214 |
-
|
| 215 |
-
if updated_prompts:
|
| 216 |
-
return f"✅ Successfully updated prompts"
|
| 217 |
-
return "No prompts were changed"
|
| 218 |
|
| 219 |
with open("page_main.css", "r") as file:
|
| 220 |
custom_css = file.read()
|
|
@@ -232,6 +294,22 @@ with gr.Blocks(title="Page Quotation Chatbot (with SOW)", css=custom_css) as pag
|
|
| 232 |
|
| 233 |
with gr.Row():
|
| 234 |
start_btn = gr.Button("Start New Session")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 235 |
with gr.Row():
|
| 236 |
current_session_display = gr.Markdown(no_active_session)
|
| 237 |
|
|
@@ -259,7 +337,7 @@ with gr.Blocks(title="Page Quotation Chatbot (with SOW)", css=custom_css) as pag
|
|
| 259 |
show_copy_button=True
|
| 260 |
)
|
| 261 |
|
| 262 |
-
(all_components, step_buttons,
|
| 263 |
page_upload_drive_btn, page_upload_notion_btn,
|
| 264 |
quotation_cost, page_recalc_btn, page_notes_box, page_save_quotation_btn , drive_folder_name) = create_quotation_generator_section()
|
| 265 |
|
|
@@ -309,21 +387,7 @@ with gr.Blocks(title="Page Quotation Chatbot (with SOW)", css=custom_css) as pag
|
|
| 309 |
]
|
| 310 |
)
|
| 311 |
|
| 312 |
-
|
| 313 |
-
prompt_editor_inputs = []
|
| 314 |
-
for prompt_key in PROMPTS:
|
| 315 |
-
if (prompt_key in all_components and
|
| 316 |
-
any(key.endswith('_prompt_editor') for key in all_components[prompt_key])):
|
| 317 |
-
editor_key = next(k for k in all_components[prompt_key].keys() if k.endswith('_prompt_editor'))
|
| 318 |
-
prompt_editor_inputs.append(all_components[prompt_key][editor_key])
|
| 319 |
-
|
| 320 |
-
save_prompts_btn.click(
|
| 321 |
-
fn=save_all_prompts,
|
| 322 |
-
inputs=prompt_editor_inputs,
|
| 323 |
-
outputs=[page_progress_update]
|
| 324 |
-
)
|
| 325 |
-
|
| 326 |
-
setup_all_handlers(step_buttons, all_components, page_progress_update, quotation_cost , page_recalc_btn , page_upload_drive_btn , drive_folder_name)
|
| 327 |
|
| 328 |
# Call setup_event_handlers after all components are created
|
| 329 |
setup_event_handlers()
|
|
|
|
| 7 |
from state import state
|
| 8 |
from page_prompts_config import PROMPTS, ModelType, UIComponentType, UIConfig, PromptConfig
|
| 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
|
|
|
|
| 34 |
interactive=config.interactive,
|
| 35 |
visible=config.visible
|
| 36 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
return None
|
| 38 |
|
| 39 |
def create_section_components(prompt_config: PromptConfig) -> Dict[str, Any]:
|
| 40 |
components = {}
|
| 41 |
|
| 42 |
+
with gr.Row():
|
| 43 |
+
with gr.Column(scale=1):
|
| 44 |
+
editor_key = next((k for k in prompt_config.ui.keys() if k.endswith('_prompt_editor')), None)
|
| 45 |
+
if editor_key:
|
| 46 |
+
lines = prompt_config.prompt.split('\n')
|
| 47 |
+
if lines:
|
| 48 |
+
min_indent = min((len(line) - len(line.lstrip())
|
| 49 |
+
for line in lines if line.strip()),
|
| 50 |
+
default=0)
|
| 51 |
+
formatted_lines = [
|
| 52 |
+
line[min_indent:] if line.strip() else ''
|
| 53 |
+
for line in lines
|
| 54 |
+
]
|
| 55 |
+
formatted_prompt = '\n'.join(formatted_lines)
|
| 56 |
+
else:
|
| 57 |
+
formatted_prompt = ""
|
| 58 |
+
|
| 59 |
+
# Create prompt editor in dropdown
|
| 60 |
+
with gr.Accordion(prompt_config.ui[editor_key].label, open=False):
|
| 61 |
+
editor = create_ui_component(
|
| 62 |
+
prompt_config.ui[editor_key],
|
| 63 |
+
formatted_prompt
|
| 64 |
+
)
|
| 65 |
+
# Add save status display
|
| 66 |
+
save_status = gr.Markdown("Ready to save changes...", visible=True)
|
| 67 |
+
|
| 68 |
+
def save_prompt_changes(new_prompt: str) -> str:
|
| 69 |
+
try:
|
| 70 |
+
# Find the correct prompt key
|
| 71 |
+
prompt_key = None
|
| 72 |
+
for key, config in PROMPTS.items():
|
| 73 |
+
if editor_key in config.ui:
|
| 74 |
+
prompt_key = key
|
| 75 |
+
break
|
| 76 |
+
|
| 77 |
+
if not prompt_key:
|
| 78 |
+
return "❌ Error: Could not find matching prompt key"
|
| 79 |
+
|
| 80 |
+
# Update in-memory config
|
| 81 |
+
PROMPTS[prompt_key].prompt = new_prompt.strip()
|
| 82 |
+
|
| 83 |
+
# Read current file content
|
| 84 |
+
with open("page_prompts_config.py", "r", encoding='utf-8') as f:
|
| 85 |
+
content = f.read()
|
| 86 |
+
|
| 87 |
+
# Find the start of the prompt section
|
| 88 |
+
section_start = f' "{prompt_key}": PromptConfig('
|
| 89 |
+
start_idx = content.find(section_start)
|
| 90 |
+
|
| 91 |
+
if start_idx == -1:
|
| 92 |
+
return "❌ Error: Could not locate prompt section in config file"
|
| 93 |
+
|
| 94 |
+
# Find the prompt= part
|
| 95 |
+
prompt_start = content.find('prompt=', start_idx)
|
| 96 |
+
if prompt_start == -1:
|
| 97 |
+
return "❌ Error: Could not locate prompt parameter"
|
| 98 |
+
|
| 99 |
+
# Find the triple quote after prompt=
|
| 100 |
+
first_quote = content.find('"""', prompt_start)
|
| 101 |
+
if first_quote == -1:
|
| 102 |
+
return "❌ Error: Could not locate start of prompt content"
|
| 103 |
+
|
| 104 |
+
# Find the closing triple quote
|
| 105 |
+
end_quote = content.find('"""', first_quote + 3)
|
| 106 |
+
if end_quote == -1:
|
| 107 |
+
return "❌ Error: Could not locate end of prompt content"
|
| 108 |
+
|
| 109 |
+
# Format the new prompt with proper indentation
|
| 110 |
+
indented_lines = []
|
| 111 |
+
for line in new_prompt.strip().split('\n'):
|
| 112 |
+
if line.strip():
|
| 113 |
+
indented_lines.append(f' {line.strip()}')
|
| 114 |
+
else:
|
| 115 |
+
indented_lines.append(' ')
|
| 116 |
+
|
| 117 |
+
# Create the new section with proper formatting
|
| 118 |
+
new_section = (
|
| 119 |
+
'prompt=\n'
|
| 120 |
+
' """\n' +
|
| 121 |
+
'\n'.join(indented_lines) +
|
| 122 |
+
'\n """'
|
| 123 |
+
)
|
| 124 |
+
|
| 125 |
+
# Replace just the prompt content
|
| 126 |
+
new_content = (
|
| 127 |
+
content[:prompt_start] +
|
| 128 |
+
new_section +
|
| 129 |
+
content[end_quote + 3:]
|
| 130 |
+
)
|
| 131 |
+
|
| 132 |
+
# Write back to file
|
| 133 |
+
with open("page_prompts_config.py", "w", encoding='utf-8') as f:
|
| 134 |
+
f.write(new_content)
|
| 135 |
+
|
| 136 |
+
return "✅ Prompt updated successfully"
|
| 137 |
+
|
| 138 |
+
except Exception as e:
|
| 139 |
+
return f"❌ Error updating prompt: {str(e)}"
|
| 140 |
+
|
| 141 |
+
# Add change handler
|
| 142 |
+
editor.change(
|
| 143 |
+
fn=save_prompt_changes,
|
| 144 |
+
inputs=[editor],
|
| 145 |
+
outputs=[save_status]
|
| 146 |
+
)
|
| 147 |
+
|
| 148 |
+
components[editor_key] = editor
|
| 149 |
+
components[f"{editor_key}_save_status"] = save_status
|
| 150 |
+
|
| 151 |
# Create output components in two columns
|
| 152 |
with gr.Row():
|
| 153 |
text_key = next((k for k in prompt_config.ui.keys() if k.endswith('_text')), None)
|
|
|
|
| 156 |
if text_key and markdown_key:
|
| 157 |
# Left column for textbox
|
| 158 |
with gr.Column(scale=1):
|
| 159 |
+
text_component = create_ui_component(
|
| 160 |
prompt_config.ui[text_key]
|
| 161 |
)
|
| 162 |
+
if text_component: # Only add if component was created
|
| 163 |
+
components[text_key] = text_component
|
| 164 |
+
|
| 165 |
# Right column for markdown
|
| 166 |
with gr.Column(scale=1):
|
| 167 |
+
markdown_component = create_ui_component(
|
| 168 |
prompt_config.ui[markdown_key]
|
| 169 |
)
|
| 170 |
+
if markdown_component: # Only add if component was created
|
| 171 |
+
components[markdown_key] = markdown_component
|
| 172 |
+
|
| 173 |
+
# Set up the dynamic update only if both components exist
|
| 174 |
+
if text_key in components and markdown_key in components:
|
| 175 |
+
components[text_key].change(
|
| 176 |
+
fn=lambda x: x,
|
| 177 |
+
inputs=[components[text_key]],
|
| 178 |
+
outputs=[components[markdown_key]]
|
| 179 |
+
)
|
| 180 |
+
|
| 181 |
+
# Then create DataFrame components each in their own row
|
| 182 |
+
for key, config in prompt_config.ui.items():
|
| 183 |
+
if config.component_type == UIComponentType.DATAFRAME:
|
| 184 |
+
with gr.Row():
|
| 185 |
+
components[key] = create_ui_component(config)
|
| 186 |
|
| 187 |
return components
|
| 188 |
|
|
|
|
| 197 |
gr.Markdown("## ⚠️ Instructions #2")
|
| 198 |
for instruction in [
|
| 199 |
"1. **Edit System Prompt**: Edit the system's prompt as you wish.",
|
| 200 |
+
"2. **Generate Output**: Proceed to click generate once prompt is edited.",
|
| 201 |
+
"3. **Upload Quotation**: Upload to Google Drive or Notion",
|
| 202 |
+
"4. **Recalculate Cost**: Recalculate the cost if you want to change the mandays estimate"
|
| 203 |
]:
|
| 204 |
gr.Markdown(instruction)
|
| 205 |
|
|
|
|
| 208 |
|
| 209 |
with gr.Row():
|
| 210 |
with gr.Column(scale=4):
|
|
|
|
|
|
|
| 211 |
prompt_steps = {}
|
| 212 |
for prompt_key, prompt_config in PROMPTS.items():
|
| 213 |
+
# Skip prompts that are chatbot editors
|
| 214 |
+
if prompt_config.step == "Chatbot Prompt Editors":
|
| 215 |
+
continue
|
| 216 |
step = prompt_config.step
|
| 217 |
if step and step.strip():
|
| 218 |
if step not in prompt_steps:
|
|
|
|
| 267 |
page_upload_notion_btn = gr.Button(" Upload to Notion")
|
| 268 |
|
| 269 |
|
| 270 |
+
return (all_components, step_buttons,
|
| 271 |
page_progress_update, page_upload_drive_btn, page_upload_notion_btn,
|
| 272 |
quotation_cost, page_recalc_btn, page_notes_box, page_save_quotation_btn , drive_folder_name)
|
| 273 |
|
|
|
|
| 277 |
gr.update(visible=(mode == "Markdown"), value=text_content)
|
| 278 |
)
|
| 279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
with open("page_main.css", "r") as file:
|
| 282 |
custom_css = file.read()
|
|
|
|
| 294 |
|
| 295 |
with gr.Row():
|
| 296 |
start_btn = gr.Button("Start New Session")
|
| 297 |
+
|
| 298 |
+
gr.Markdown("Below are the prompt editors & requirement rubric for the chatbot :")
|
| 299 |
+
with gr.Row():
|
| 300 |
+
# Add chatbot prompt editors section using create_section_components
|
| 301 |
+
chatbot_editors = {}
|
| 302 |
+
with gr.Accordion("Chatbot Prompt Editors", open=False):
|
| 303 |
+
chatbot_prompts = {
|
| 304 |
+
key: config for key, config in PROMPTS.items()
|
| 305 |
+
if config.step == "Chatbot Prompt Editors"
|
| 306 |
+
}
|
| 307 |
+
|
| 308 |
+
for prompt_key, prompt_config in chatbot_prompts.items():
|
| 309 |
+
with gr.Accordion(prompt_config.description, open=False):
|
| 310 |
+
components = create_section_components(prompt_config)
|
| 311 |
+
chatbot_editors[prompt_key] = components
|
| 312 |
+
|
| 313 |
with gr.Row():
|
| 314 |
current_session_display = gr.Markdown(no_active_session)
|
| 315 |
|
|
|
|
| 337 |
show_copy_button=True
|
| 338 |
)
|
| 339 |
|
| 340 |
+
(all_components, step_buttons, page_progress_update,
|
| 341 |
page_upload_drive_btn, page_upload_notion_btn,
|
| 342 |
quotation_cost, page_recalc_btn, page_notes_box, page_save_quotation_btn , drive_folder_name) = create_quotation_generator_section()
|
| 343 |
|
|
|
|
| 387 |
]
|
| 388 |
)
|
| 389 |
|
| 390 |
+
setup_all_handlers(step_buttons, all_components, page_progress_update, quotation_cost , page_recalc_btn , page_upload_drive_btn , page_upload_notion_btn ,drive_folder_name)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
|
| 392 |
# Call setup_event_handlers after all components are created
|
| 393 |
setup_event_handlers()
|
event_handlers.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
from Project import *
|
| 2 |
-
from google_drive import *
|
|
|
|
| 3 |
|
| 4 |
-
def setup_all_handlers(step_buttons, all_components, page_progress_update, quotation_cost , page_recalc_btn ,
|
| 5 |
"""Set up all step handlers with the provided UI components"""
|
| 6 |
step_buttons['Step 1 : Scope & Components'].click(
|
| 7 |
fn=state.quotation_project.generate_prd_and_components,
|
|
@@ -13,6 +14,8 @@ def setup_all_handlers(step_buttons, all_components, page_progress_update, quota
|
|
| 13 |
all_components['generate_plan_test_components']['generated_plan_test_components_markdown'],
|
| 14 |
all_components['generate_dev_components']['generated_dev_components_text'],
|
| 15 |
all_components['generate_dev_components']['generated_dev_components_markdown'],
|
|
|
|
|
|
|
| 16 |
page_progress_update
|
| 17 |
],
|
| 18 |
)
|
|
@@ -21,7 +24,7 @@ def setup_all_handlers(step_buttons, all_components, page_progress_update, quota
|
|
| 21 |
fn=state.quotation_project.generate_mandays_and_quotation,
|
| 22 |
inputs=[
|
| 23 |
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 24 |
-
all_components['
|
| 25 |
],
|
| 26 |
outputs=[
|
| 27 |
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
|
@@ -37,7 +40,7 @@ def setup_all_handlers(step_buttons, all_components, page_progress_update, quota
|
|
| 37 |
inputs=[
|
| 38 |
all_components['generate_prd']['generated_prd_text'],
|
| 39 |
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 40 |
-
all_components['
|
| 41 |
quotation_cost
|
| 42 |
],
|
| 43 |
outputs=[
|
|
@@ -62,22 +65,41 @@ def setup_all_handlers(step_buttons, all_components, page_progress_update, quota
|
|
| 62 |
]
|
| 63 |
)
|
| 64 |
|
| 65 |
-
|
| 66 |
fn=upload_to_gdrive,
|
| 67 |
inputs=[
|
| 68 |
drive_folder_name,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
all_components['generate_prd']['generated_prd_markdown'],
|
| 70 |
all_components['generate_plan_test_components']['generated_plan_test_components_markdown'],
|
| 71 |
-
all_components['
|
| 72 |
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 73 |
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
|
|
|
| 74 |
quotation_cost,
|
| 75 |
-
all_components['generate_BD_SOW']['
|
| 76 |
-
all_components['generate_Tech_SOW']['
|
| 77 |
],
|
| 78 |
outputs=[
|
| 79 |
page_progress_update
|
| 80 |
]
|
| 81 |
-
)
|
| 82 |
|
| 83 |
|
|
|
|
| 1 |
from Project import *
|
| 2 |
+
from google_drive import *
|
| 3 |
+
from notion import upload_to_notion
|
| 4 |
|
| 5 |
+
def setup_all_handlers(step_buttons, all_components, page_progress_update, quotation_cost , page_recalc_btn , page_upload_drive_btn , page_upload_notion_btn ,drive_folder_name):
|
| 6 |
"""Set up all step handlers with the provided UI components"""
|
| 7 |
step_buttons['Step 1 : Scope & Components'].click(
|
| 8 |
fn=state.quotation_project.generate_prd_and_components,
|
|
|
|
| 14 |
all_components['generate_plan_test_components']['generated_plan_test_components_markdown'],
|
| 15 |
all_components['generate_dev_components']['generated_dev_components_text'],
|
| 16 |
all_components['generate_dev_components']['generated_dev_components_markdown'],
|
| 17 |
+
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 18 |
+
all_components['reformat_dev_components']['reformatted_dev_components_markdown'],
|
| 19 |
page_progress_update
|
| 20 |
],
|
| 21 |
)
|
|
|
|
| 24 |
fn=state.quotation_project.generate_mandays_and_quotation,
|
| 25 |
inputs=[
|
| 26 |
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 27 |
+
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 28 |
],
|
| 29 |
outputs=[
|
| 30 |
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
|
|
|
| 40 |
inputs=[
|
| 41 |
all_components['generate_prd']['generated_prd_text'],
|
| 42 |
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 43 |
+
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 44 |
quotation_cost
|
| 45 |
],
|
| 46 |
outputs=[
|
|
|
|
| 65 |
]
|
| 66 |
)
|
| 67 |
|
| 68 |
+
page_upload_drive_btn.click(
|
| 69 |
fn=upload_to_gdrive,
|
| 70 |
inputs=[
|
| 71 |
drive_folder_name,
|
| 72 |
+
all_components['generate_prd']['generated_prd_text'],
|
| 73 |
+
all_components['generate_plan_test_components']['generated_plan_test_components_text'],
|
| 74 |
+
all_components['reformat_dev_components']['reformatted_dev_components_text'],
|
| 75 |
+
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 76 |
+
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 77 |
+
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 78 |
+
quotation_cost,
|
| 79 |
+
all_components['generate_BD_SOW']['generated_BD_SOW_text'],
|
| 80 |
+
all_components['generate_Tech_SOW']['generated_Tech_SOW_text'],
|
| 81 |
+
],
|
| 82 |
+
outputs=[
|
| 83 |
+
page_progress_update
|
| 84 |
+
]
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
page_upload_notion_btn.click(
|
| 88 |
+
fn=upload_to_notion,
|
| 89 |
+
inputs=[
|
| 90 |
all_components['generate_prd']['generated_prd_markdown'],
|
| 91 |
all_components['generate_plan_test_components']['generated_plan_test_components_markdown'],
|
| 92 |
+
all_components['reformat_dev_components']['reformatted_dev_components_markdown'],
|
| 93 |
all_components['generate_plan_test_mandays']['generated_plan_test_mandays_dataframe'],
|
| 94 |
all_components['generate_dev_mandays']['generated_dev_mandays_dataframe'],
|
| 95 |
+
all_components['generate_MVP_mandays']['generated_MVP_mandays_dataframe'],
|
| 96 |
quotation_cost,
|
| 97 |
+
all_components['generate_BD_SOW']['generated_BD_SOW_text'],
|
| 98 |
+
all_components['generate_Tech_SOW']['generated_Tech_SOW_text'],
|
| 99 |
],
|
| 100 |
outputs=[
|
| 101 |
page_progress_update
|
| 102 |
]
|
| 103 |
+
)
|
| 104 |
|
| 105 |
|
google_drive.py
CHANGED
|
@@ -237,8 +237,31 @@ def upload_content(service, folder_id, filename, content):
|
|
| 237 |
except HttpError as error:
|
| 238 |
print(f"An error occurred while uploading {filename}: {error}")
|
| 239 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 240 |
|
| 241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 242 |
print("Starting v3_upload_to_gdrive process...")
|
| 243 |
service = authenticate_drive_service()
|
| 244 |
|
|
@@ -260,18 +283,22 @@ def upload_to_gdrive(folder_name,prd_box, plan_test_component_table,dev_componen
|
|
| 260 |
print(f"Created subfolder with ID: {subfolder_id}")
|
| 261 |
|
| 262 |
try:
|
|
|
|
|
|
|
| 263 |
combined_content = f"""
|
| 264 |
-
# Cost Summary
|
| 265 |
-
{cost_summary}
|
| 266 |
-
|
| 267 |
-
# Planning and Testing Component
|
| 268 |
-
{plan_test_component_table}
|
| 269 |
-
|
| 270 |
-
# Dev Component
|
| 271 |
-
{dev_component_table}
|
|
|
|
|
|
|
|
|
|
| 272 |
|
| 273 |
"""
|
| 274 |
-
|
| 275 |
# Upload files to subfolder
|
| 276 |
upload_content(service, subfolder_id, "quotation_document.md", combined_content)
|
| 277 |
upload_content(service, subfolder_id, "requirements_doc.md", prd_box)
|
|
@@ -281,7 +308,8 @@ def upload_to_gdrive(folder_name,prd_box, plan_test_component_table,dev_componen
|
|
| 281 |
upload_content(service, subfolder_id, "plan_test_mandays.csv", plan_test_mandays)
|
| 282 |
if dev_mandays is not None:
|
| 283 |
upload_content(service, subfolder_id, "dev_mandays.csv", dev_mandays)
|
| 284 |
-
|
|
|
|
| 285 |
# return f"All files uploaded to subfolder ID: {subfolder_id}"
|
| 286 |
|
| 287 |
# Construct the folder URL
|
|
|
|
| 237 |
except HttpError as error:
|
| 238 |
print(f"An error occurred while uploading {filename}: {error}")
|
| 239 |
|
| 240 |
+
def convert_df_to_text(df):
|
| 241 |
+
"""
|
| 242 |
+
Convert a DataFrame to a formatted Markdown table string.
|
| 243 |
+
Ensures consistent table formatting with pipe characters.
|
| 244 |
+
"""
|
| 245 |
+
if df is None or df.empty:
|
| 246 |
+
return ""
|
| 247 |
+
|
| 248 |
+
# Create header with proper markdown formatting
|
| 249 |
+
header = " | ".join(f"**{str(col)}**" for col in df.columns)
|
| 250 |
+
|
| 251 |
+
# Create separator
|
| 252 |
+
separator = "|".join("-" * len(col) for col in df.columns)
|
| 253 |
|
| 254 |
+
# Create rows with proper formatting
|
| 255 |
+
rows = []
|
| 256 |
+
for _, row in df.iterrows():
|
| 257 |
+
formatted_row = " | ".join(str(val) for val in row.items())
|
| 258 |
+
rows.append(f"| {formatted_row} |")
|
| 259 |
+
|
| 260 |
+
# Combine all parts with proper markdown table formatting
|
| 261 |
+
table = f"| {header} |\n|{separator}|\n" + "\n".join(rows)
|
| 262 |
+
return table
|
| 263 |
+
|
| 264 |
+
def upload_to_gdrive(folder_name,prd_box, plan_test_component_table,dev_component_table, plan_test_mandays,dev_mandays, mvp_mandays, cost_summary,general_sow,detailed_sow):
|
| 265 |
print("Starting v3_upload_to_gdrive process...")
|
| 266 |
service = authenticate_drive_service()
|
| 267 |
|
|
|
|
| 283 |
print(f"Created subfolder with ID: {subfolder_id}")
|
| 284 |
|
| 285 |
try:
|
| 286 |
+
mvp_mandays_text = convert_df_to_text(mvp_mandays)
|
| 287 |
+
|
| 288 |
combined_content = f"""
|
| 289 |
+
# Cost Summary
|
| 290 |
+
{cost_summary}
|
| 291 |
+
|
| 292 |
+
# Planning and Testing Component
|
| 293 |
+
{plan_test_component_table}
|
| 294 |
+
|
| 295 |
+
# Dev Component
|
| 296 |
+
{dev_component_table}
|
| 297 |
+
|
| 298 |
+
# MVP Mandays
|
| 299 |
+
{mvp_mandays_text}
|
| 300 |
|
| 301 |
"""
|
|
|
|
| 302 |
# Upload files to subfolder
|
| 303 |
upload_content(service, subfolder_id, "quotation_document.md", combined_content)
|
| 304 |
upload_content(service, subfolder_id, "requirements_doc.md", prd_box)
|
|
|
|
| 308 |
upload_content(service, subfolder_id, "plan_test_mandays.csv", plan_test_mandays)
|
| 309 |
if dev_mandays is not None:
|
| 310 |
upload_content(service, subfolder_id, "dev_mandays.csv", dev_mandays)
|
| 311 |
+
if mvp_mandays is not None:
|
| 312 |
+
upload_content(service, subfolder_id, "mvp_mandays.csv", mvp_mandays)
|
| 313 |
# return f"All files uploaded to subfolder ID: {subfolder_id}"
|
| 314 |
|
| 315 |
# Construct the folder URL
|
notion.py
CHANGED
|
@@ -2,6 +2,10 @@ import os
|
|
| 2 |
from notion_client import Client
|
| 3 |
from datetime import datetime
|
| 4 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
def convert_df_to_markdown(df):
|
| 7 |
"""Convert DataFrame to markdown table string"""
|
|
@@ -13,26 +17,29 @@ def split_text_into_chunks(text, max_length=2000):
|
|
| 13 |
"""Split text into chunks of a specified maximum length."""
|
| 14 |
return [text[i:i + max_length] for i in range(0, len(text), max_length)]
|
| 15 |
|
| 16 |
-
def
|
| 17 |
-
plan_test_mandays, dev_mandays,
|
| 18 |
-
|
| 19 |
"""Upload content to a Notion page"""
|
| 20 |
try:
|
| 21 |
# Initialize Notion client
|
| 22 |
notion = Client(auth=os.getenv("NOTION_TOKEN"))
|
| 23 |
page_id = os.getenv("NOTION_PAGE_ID")
|
| 24 |
|
| 25 |
-
if not notion
|
| 26 |
return "Error: Notion credentials not configured. Check your .env file."
|
| 27 |
-
|
|
|
|
|
|
|
| 28 |
# Create page title with timestamp
|
| 29 |
timestamp = datetime.now().strftime("%y%m%d_%H%M%S")
|
| 30 |
-
page_title = f"
|
| 31 |
|
| 32 |
# Convert DataFrames to markdown tables if needed
|
| 33 |
plan_test_mandays_md = convert_df_to_markdown(plan_test_mandays) if isinstance(plan_test_mandays, pd.DataFrame) else str(plan_test_mandays)
|
| 34 |
dev_mandays_md = convert_df_to_markdown(dev_mandays) if isinstance(dev_mandays, pd.DataFrame) else str(dev_mandays)
|
| 35 |
-
|
|
|
|
| 36 |
# Initialize content blocks array
|
| 37 |
content_blocks = [
|
| 38 |
{
|
|
@@ -59,29 +66,63 @@ def v3_upload_to_notion(prd_box, plan_test_component_table, dev_component_table,
|
|
| 59 |
# Split content into chunks and add each chunk
|
| 60 |
chunks = split_text_into_chunks(str(content))
|
| 61 |
for chunk in chunks:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
"
|
| 67 |
-
|
| 68 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
-
# Add each section using the helper function
|
| 71 |
-
add_text_content("Cost Summary", cost_summary, "callout")
|
| 72 |
-
add_text_content("Analysis", analysis_box)
|
| 73 |
-
add_text_content("Requirements", prd_box)
|
| 74 |
-
add_text_content("Planning & Testing Components", plan_test_component_table)
|
| 75 |
-
add_text_content("Development Components", dev_component_table)
|
| 76 |
-
|
| 77 |
# Add Mandays Estimation section
|
| 78 |
content_blocks.append({
|
| 79 |
"object": "block",
|
| 80 |
"type": "heading_2",
|
| 81 |
"heading_2": {
|
| 82 |
-
"rich_text": [{"type": "text", "text": {"content": "Mandays Estimation"}}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
|
| 86 |
# Planning & Testing Mandays
|
| 87 |
content_blocks.append({
|
|
@@ -102,15 +143,17 @@ def v3_upload_to_notion(prd_box, plan_test_component_table, dev_component_table,
|
|
| 102 |
}
|
| 103 |
})
|
| 104 |
add_text_content("", dev_mandays_md, "code")
|
| 105 |
-
|
| 106 |
-
#
|
| 107 |
content_blocks.append({
|
| 108 |
"object": "block",
|
| 109 |
-
"type": "
|
| 110 |
-
"
|
| 111 |
-
"rich_text": [{"type": "text", "text": {"content": "
|
| 112 |
}
|
| 113 |
})
|
|
|
|
|
|
|
| 114 |
|
| 115 |
# General SOW
|
| 116 |
content_blocks.append({
|
|
@@ -120,7 +163,7 @@ def v3_upload_to_notion(prd_box, plan_test_component_table, dev_component_table,
|
|
| 120 |
"rich_text": [{"type": "text", "text": {"content": "General SOW"}}]
|
| 121 |
}
|
| 122 |
})
|
| 123 |
-
add_text_content("",
|
| 124 |
|
| 125 |
# Technical SOW
|
| 126 |
content_blocks.append({
|
|
@@ -130,7 +173,7 @@ def v3_upload_to_notion(prd_box, plan_test_component_table, dev_component_table,
|
|
| 130 |
"rich_text": [{"type": "text", "text": {"content": "Technical SOW"}}]
|
| 131 |
}
|
| 132 |
})
|
| 133 |
-
add_text_content("",
|
| 134 |
|
| 135 |
# Add divider and timestamp
|
| 136 |
content_blocks.extend([
|
|
|
|
| 2 |
from notion_client import Client
|
| 3 |
from datetime import datetime
|
| 4 |
import pandas as pd
|
| 5 |
+
from dotenv import load_dotenv
|
| 6 |
+
|
| 7 |
+
load_dotenv()
|
| 8 |
+
|
| 9 |
|
| 10 |
def convert_df_to_markdown(df):
|
| 11 |
"""Convert DataFrame to markdown table string"""
|
|
|
|
| 17 |
"""Split text into chunks of a specified maximum length."""
|
| 18 |
return [text[i:i + max_length] for i in range(0, len(text), max_length)]
|
| 19 |
|
| 20 |
+
def upload_to_notion(prd_box, plan_test_component_table, dev_component_table,
|
| 21 |
+
plan_test_mandays, dev_mandays, mvp_mandays, cost_summary,
|
| 22 |
+
BD_sow, Tech_sow):
|
| 23 |
"""Upload content to a Notion page"""
|
| 24 |
try:
|
| 25 |
# Initialize Notion client
|
| 26 |
notion = Client(auth=os.getenv("NOTION_TOKEN"))
|
| 27 |
page_id = os.getenv("NOTION_PAGE_ID")
|
| 28 |
|
| 29 |
+
if not notion :
|
| 30 |
return "Error: Notion credentials not configured. Check your .env file."
|
| 31 |
+
|
| 32 |
+
if not page_id:
|
| 33 |
+
return "Error: Notion page ID not configured. Check your .env file."
|
| 34 |
# Create page title with timestamp
|
| 35 |
timestamp = datetime.now().strftime("%y%m%d_%H%M%S")
|
| 36 |
+
page_title = f"Quotation_Chatbot_Page_{timestamp}"
|
| 37 |
|
| 38 |
# Convert DataFrames to markdown tables if needed
|
| 39 |
plan_test_mandays_md = convert_df_to_markdown(plan_test_mandays) if isinstance(plan_test_mandays, pd.DataFrame) else str(plan_test_mandays)
|
| 40 |
dev_mandays_md = convert_df_to_markdown(dev_mandays) if isinstance(dev_mandays, pd.DataFrame) else str(dev_mandays)
|
| 41 |
+
mvp_mandays_md = convert_df_to_markdown(mvp_mandays) if isinstance(mvp_mandays, pd.DataFrame) else str(mvp_mandays)
|
| 42 |
+
|
| 43 |
# Initialize content blocks array
|
| 44 |
content_blocks = [
|
| 45 |
{
|
|
|
|
| 66 |
# Split content into chunks and add each chunk
|
| 67 |
chunks = split_text_into_chunks(str(content))
|
| 68 |
for chunk in chunks:
|
| 69 |
+
if block_type == "code":
|
| 70 |
+
content_blocks.append({
|
| 71 |
+
"object": "block",
|
| 72 |
+
"type": "code",
|
| 73 |
+
"code": {
|
| 74 |
+
"language": "plain text",
|
| 75 |
+
"rich_text": [{"type": "text", "text": {"content": chunk}}]
|
| 76 |
+
}
|
| 77 |
+
})
|
| 78 |
+
else:
|
| 79 |
+
content_blocks.append({
|
| 80 |
+
"object": "block",
|
| 81 |
+
"type": block_type,
|
| 82 |
+
block_type: {
|
| 83 |
+
"rich_text": [{"type": "text", "text": {"content": chunk}}]
|
| 84 |
+
}
|
| 85 |
+
})
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
# Add Mandays Estimation section
|
| 88 |
content_blocks.append({
|
| 89 |
"object": "block",
|
| 90 |
"type": "heading_2",
|
| 91 |
"heading_2": {
|
| 92 |
+
"rich_text": [{"type": "text", "text": {"content": "Quotation Cost & Mandays Estimation"}}]
|
| 93 |
+
}
|
| 94 |
+
})
|
| 95 |
+
add_text_content("Cost Summary", cost_summary, "callout")
|
| 96 |
+
|
| 97 |
+
# Add Requirements section
|
| 98 |
+
content_blocks.append({
|
| 99 |
+
"object": "block",
|
| 100 |
+
"type": "heading_2",
|
| 101 |
+
"heading_2": {
|
| 102 |
+
"rich_text": [{"type": "text", "text": {"content": "Project Requirements"}}]
|
| 103 |
}
|
| 104 |
})
|
| 105 |
+
add_text_content("Project Requirements", prd_box)
|
| 106 |
+
|
| 107 |
+
# Plan & Test Components
|
| 108 |
+
content_blocks.append({
|
| 109 |
+
"object": "block",
|
| 110 |
+
"type": "heading_3",
|
| 111 |
+
"heading_3": {
|
| 112 |
+
"rich_text": [{"type": "text", "text": {"content": "Planning & Testing Components"}}]
|
| 113 |
+
}
|
| 114 |
+
})
|
| 115 |
+
add_text_content("Planning & Testing Components", plan_test_component_table, "code")
|
| 116 |
+
|
| 117 |
+
# Development Components
|
| 118 |
+
content_blocks.append({
|
| 119 |
+
"object": "block",
|
| 120 |
+
"type": "heading_3",
|
| 121 |
+
"heading_3": {
|
| 122 |
+
"rich_text": [{"type": "text", "text": {"content": "Development Components"}}]
|
| 123 |
+
}
|
| 124 |
+
})
|
| 125 |
+
add_text_content("Development Components", dev_component_table, "code")
|
| 126 |
|
| 127 |
# Planning & Testing Mandays
|
| 128 |
content_blocks.append({
|
|
|
|
| 143 |
}
|
| 144 |
})
|
| 145 |
add_text_content("", dev_mandays_md, "code")
|
| 146 |
+
|
| 147 |
+
# MVP Mandays
|
| 148 |
content_blocks.append({
|
| 149 |
"object": "block",
|
| 150 |
+
"type": "heading_3",
|
| 151 |
+
"heading_3": {
|
| 152 |
+
"rich_text": [{"type": "text", "text": {"content": "MVP Mandays"}}]
|
| 153 |
}
|
| 154 |
})
|
| 155 |
+
add_text_content("", mvp_mandays_md, "code")
|
| 156 |
+
|
| 157 |
|
| 158 |
# General SOW
|
| 159 |
content_blocks.append({
|
|
|
|
| 163 |
"rich_text": [{"type": "text", "text": {"content": "General SOW"}}]
|
| 164 |
}
|
| 165 |
})
|
| 166 |
+
add_text_content("Business Development SOW", BD_sow)
|
| 167 |
|
| 168 |
# Technical SOW
|
| 169 |
content_blocks.append({
|
|
|
|
| 173 |
"rich_text": [{"type": "text", "text": {"content": "Technical SOW"}}]
|
| 174 |
}
|
| 175 |
})
|
| 176 |
+
add_text_content("Technical Development SOW", Tech_sow)
|
| 177 |
|
| 178 |
# Add divider and timestamp
|
| 179 |
content_blocks.extend([
|
page_prompts_config.py
CHANGED
|
@@ -11,11 +11,7 @@ class UIComponentType(Enum):
|
|
| 11 |
MARKDOWN = "markdown"
|
| 12 |
DATAFRAME = "dataframe"
|
| 13 |
BUTTON = "button"
|
| 14 |
-
|
| 15 |
-
ACCORDION = "accordion"
|
| 16 |
-
TAB = "tab"
|
| 17 |
-
ROW = "row"
|
| 18 |
-
COLUMN = "column"
|
| 19 |
|
| 20 |
@dataclass
|
| 21 |
class UIConfig:
|
|
@@ -35,7 +31,6 @@ class PromptConfig:
|
|
| 35 |
inputs: List[str]
|
| 36 |
outputs: List[str]
|
| 37 |
model: ModelType
|
| 38 |
-
editable: bool = True
|
| 39 |
description: str = ""
|
| 40 |
step: str = ""
|
| 41 |
ui: Dict[str, UIConfig] = None
|
|
@@ -70,13 +65,14 @@ PROMPTS = {
|
|
| 70 |
inputs=[],
|
| 71 |
outputs=[],
|
| 72 |
model=ModelType.O1_MINI,
|
| 73 |
-
|
| 74 |
-
|
| 75 |
ui={
|
| 76 |
-
"
|
| 77 |
component_type=UIComponentType.TEXTBOX,
|
| 78 |
-
label="Initial Questions",
|
| 79 |
-
interactive=
|
|
|
|
| 80 |
)
|
| 81 |
}
|
| 82 |
),
|
|
@@ -116,19 +112,19 @@ PROMPTS = {
|
|
| 116 |
inputs=['project_detail'],
|
| 117 |
outputs=['client_follow_up_questions'],
|
| 118 |
model=ModelType.O1_MINI,
|
| 119 |
-
|
| 120 |
-
|
| 121 |
ui={
|
| 122 |
-
"
|
| 123 |
-
component_type=UIComponentType.
|
| 124 |
-
label="Follow-up Questions",
|
| 125 |
-
interactive=
|
| 126 |
-
|
| 127 |
)
|
| 128 |
}
|
| 129 |
),
|
| 130 |
|
| 131 |
-
"
|
| 132 |
prompt=
|
| 133 |
"""
|
| 134 |
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.
|
|
@@ -154,14 +150,107 @@ PROMPTS = {
|
|
| 154 |
inputs=['generated_prd'],
|
| 155 |
outputs=['follow_up_questions'],
|
| 156 |
model=ModelType.O1_MINI,
|
| 157 |
-
|
| 158 |
-
|
| 159 |
ui={
|
| 160 |
-
"
|
| 161 |
-
component_type=UIComponentType.
|
| 162 |
label="Follow-up Questions",
|
| 163 |
-
interactive=
|
| 164 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
)
|
| 166 |
}
|
| 167 |
),
|
|
@@ -170,11 +259,11 @@ PROMPTS = {
|
|
| 170 |
prompt=
|
| 171 |
"""
|
| 172 |
Rewrite this for clarity while keeping ALL specific details, metrics, and constraints.
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
""",
|
| 179 |
inputs=["project_detail"],
|
| 180 |
outputs=["generated_prd"],
|
|
@@ -203,68 +292,21 @@ PROMPTS = {
|
|
| 203 |
}
|
| 204 |
),
|
| 205 |
|
| 206 |
-
"generate_client_followup_question": PromptConfig(
|
| 207 |
-
prompt=
|
| 208 |
-
"""
|
| 209 |
-
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:
|
| 210 |
-
|
| 211 |
-
1. **Client Overview**
|
| 212 |
-
**Objective:** ask relevant questions that will directly contribute to better project requirements gathering. (ie: department team that the project is meant for ..etc)
|
| 213 |
-
|
| 214 |
-
2. **Project Vision and Value**
|
| 215 |
-
**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.
|
| 216 |
-
**Focus:** Investigate specific outcomes, immediate expected goals, and how success will be defined.
|
| 217 |
-
|
| 218 |
-
3. **Existing System or Workflow Description**
|
| 219 |
-
**Objective:** Delve deeper into the client's current tools, workflows, and processes to uncover pain points, integration requirements, and opportunities for optimization.
|
| 220 |
-
**Focus:** Identify inefficiencies, technical limitations, or gaps that the project will address.
|
| 221 |
-
|
| 222 |
-
4. **Budget and Resource Constraints**
|
| 223 |
-
**Objective:** Clearly define any limitations or constraints—financial, resource-based, or time-related—that could impact project success.
|
| 224 |
-
**Focus:** Understand the flexibility of the budget, timeline expectations, and resource availability.
|
| 225 |
-
|
| 226 |
-
Instructions:
|
| 227 |
-
Each question should:
|
| 228 |
-
Build on provided client information
|
| 229 |
-
Non repetitive, and unique. Avoid asking similar questions.
|
| 230 |
-
Include realistic sample answers relevant to the client's context
|
| 231 |
-
Focus on gathering quantifiable or specific information
|
| 232 |
-
|
| 233 |
-
|
| 234 |
-
Output top 10 questions in the following format:
|
| 235 |
-
<question>(sample answers)
|
| 236 |
-
Just return the text and NOTHING else. Do not overexplain, omit code guards.
|
| 237 |
-
""",
|
| 238 |
-
inputs=['project_detail'],
|
| 239 |
-
outputs=['client_followup_question_sample_answers'],
|
| 240 |
-
model=ModelType.O1_MINI,
|
| 241 |
-
editable=True,
|
| 242 |
-
description="Generate client follow up question with sample answers based on project detail",
|
| 243 |
-
ui={
|
| 244 |
-
"follow_up_display": UIConfig(
|
| 245 |
-
component_type=UIComponentType.MARKDOWN,
|
| 246 |
-
label="Follow-up Questions",
|
| 247 |
-
interactive=False,
|
| 248 |
-
show_copy_button=True
|
| 249 |
-
)
|
| 250 |
-
}
|
| 251 |
-
),
|
| 252 |
-
|
| 253 |
"generate_plan_test_components": PromptConfig(
|
| 254 |
prompt=
|
| 255 |
"""
|
| 256 |
Context:
|
| 257 |
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).
|
| 258 |
-
|
| 259 |
Instructions:
|
| 260 |
Break the project into the following phases:
|
| 261 |
-
1. Planning Phase ( Potention Focus: Requirement gathering,Technical architecture design, Resource Allocation.. etc)
|
| 262 |
2. Testing Phase ( Potention Focus: Integration testing, System testing, User Acceptance Testing (UAT) )
|
| 263 |
-
|
| 264 |
Components:
|
| 265 |
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.
|
| 266 |
Use the PRD to extract relevant, granular components that reflect deliverables unique to this project.
|
| 267 |
-
|
| 268 |
Output Format:
|
| 269 |
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 270 |
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
|
@@ -299,41 +341,43 @@ PROMPTS = {
|
|
| 299 |
"generate_dev_components": PromptConfig(
|
| 300 |
prompt=
|
| 301 |
"""
|
| 302 |
-
As a Senior Software Architect with 20+ years of experience
|
| 303 |
-
|
| 304 |
-
Specific
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
**Output Format:**
|
| 314 |
- Title: Component Name as Table Title (e.g., "Frontend Components")
|
| 315 |
- Table Structure:
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
|
|
|
| 321 |
Frontend Component
|
| 322 |
-
| Component
|
| 323 |
-
|
|
| 324 |
-
|
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
|
| 333 |
-
|
| 334 |
-
|
| 335 |
-
|
| 336 |
-
|
|
|
|
| 337 |
""",
|
| 338 |
inputs=["generated_prd"],
|
| 339 |
outputs=["generated_dev_components"],
|
|
@@ -361,34 +405,100 @@ PROMPTS = {
|
|
| 361 |
)
|
| 362 |
}
|
| 363 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 364 |
|
| 365 |
"generate_plan_test_mandays": PromptConfig(
|
| 366 |
prompt=
|
| 367 |
"""
|
| 368 |
You are an experienced project manager tasked to create a detailed task breakdown for a project based on the planning and testing component list.
|
| 369 |
-
|
| 370 |
Objective:
|
| 371 |
Generate a structured CSV output with manday estimates for each planning and testing component.
|
| 372 |
-
|
| 373 |
Instructions:
|
| 374 |
1. Use the planning and testing component list to identify all components
|
| 375 |
2. For each component:
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
Output Format Requirements:
|
| 381 |
- Generate a CSV with EXACTLY these column headers: "component,mandays,description"
|
| 382 |
- Each row must have all three columns filled
|
| 383 |
- Numeric values should not be quoted
|
| 384 |
- Text values must be enclosed in double quotes
|
| 385 |
- No empty rows or missing values
|
| 386 |
-
|
| 387 |
Example Output:
|
| 388 |
component,mandays,description
|
| 389 |
"Project Planning",2.5,"Detailed project planning including timeline and resource allocation"
|
| 390 |
"Requirements Analysis",1.5,"Analysis and documentation of system requirements"
|
| 391 |
-
|
| 392 |
Return only the CSV content, no code blocks or additional text.
|
| 393 |
""",
|
| 394 |
inputs=["generated_plan_test_components"],
|
|
@@ -415,22 +525,21 @@ PROMPTS = {
|
|
| 415 |
prompt=
|
| 416 |
"""
|
| 417 |
You are an experienced project manager tasked to create a detailed task breakdown for development components.
|
| 418 |
-
|
| 419 |
-
|
| 420 |
Objective:
|
| 421 |
Generate a structured CSV output with manday estimates for each development component and subcomponent from the provided development component list.
|
| 422 |
-
|
| 423 |
Critical CSV Format Requirements:
|
| 424 |
1. First line MUST be exactly: component,subcomponent,mandays,description
|
| 425 |
2. Each subsequent line MUST contain actual data with:
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
3. No empty lines or missing values
|
| 431 |
4. Text values must be in double quotes
|
| 432 |
5. Numbers must not be in quotes
|
| 433 |
-
|
| 434 |
Example Valid Output:
|
| 435 |
component,subcomponent,mandays,description
|
| 436 |
"Frontend","User Authentication",3.5,"Implementation of login/logout functionality with security features"
|
|
@@ -439,18 +548,18 @@ PROMPTS = {
|
|
| 439 |
"Backend","Database Integration",2,"Implementation of database connections and queries"
|
| 440 |
"Infrastructure","Docker Setup",1.5,"Container configuration and deployment setup"
|
| 441 |
"Infrastructure","CI/CD Pipeline",2,"Setup of automated build and deployment pipeline"
|
| 442 |
-
|
| 443 |
Instructions:
|
| 444 |
1. Parse the provided development component list
|
| 445 |
2. For EACH component and subcomponent in the list:
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
3. Return ONLY the CSV content - no explanations or code blocks
|
| 450 |
-
|
| 451 |
YOU MUST GENERATE ACTUAL DATA ROWS based on the development component list provided.
|
| 452 |
""",
|
| 453 |
-
inputs=["
|
| 454 |
outputs=["generated_dev_mandays"],
|
| 455 |
model=ModelType.O1_MINI,
|
| 456 |
description="Generate development mandays",
|
|
@@ -470,157 +579,51 @@ PROMPTS = {
|
|
| 470 |
}
|
| 471 |
),
|
| 472 |
|
| 473 |
-
|
| 474 |
-
"gather_project_input": PromptConfig(
|
| 475 |
-
prompt=
|
| 476 |
-
"""
|
| 477 |
-
**You are a Software Development Expert specializing in scalable, secure, and robust document processing systems.
|
| 478 |
-
You will be provided with client background information.
|
| 479 |
-
Your task is to create a dynamic, context-aware list of questions to collaboratively gather client requirements for a document processing application.
|
| 480 |
-
Use the list below as a baseline. Generate additional, relevant questions on top of this baseline where appropriate.
|
| 481 |
-
Use the client's context to add clarity or relevance to the question.
|
| 482 |
-
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.
|
| 483 |
-
### Areas to Cover:
|
| 484 |
-
---
|
| 485 |
-
Document Types:
|
| 486 |
-
<client context>, What specific types of documents will the application need to process (e.g., invoices, legal contracts, ID forms)?
|
| 487 |
-
<client context>, Are there specific complexities or variations in these documents that we should account for (e.g., multi-page documents, handwritten content)?
|
| 488 |
-
Inputs and Outputs:
|
| 489 |
-
<client context>, What are the expected input formats (e.g., PDFs, images, scanned documents)?
|
| 490 |
-
<client context>, What should the processed outputs look like (e.g., structured data, summaries, reports)?
|
| 491 |
-
<client context>, Are there any specific formatting requirements for outputs?
|
| 492 |
-
Document Quality:
|
| 493 |
-
<client context>, Are the documents typically clean and structured, or will the application need preprocessing capabilities (e.g., OCR, noise reduction)?
|
| 494 |
-
<client context>, Do you foresee any challenges with document quality, such as low resolution or inconsistent formatting?
|
| 495 |
-
Workflow Mapping:
|
| 496 |
-
<client context>, Can you describe your current document processing workflow?
|
| 497 |
-
<client context>, What are the major pain points or inefficiencies in the current process?
|
| 498 |
-
<client context>, Which parts of the workflow involve manual interventions, and how would you like to streamline them?
|
| 499 |
-
Integration Points:
|
| 500 |
-
<client context>, What existing systems or third-party tools does the application need to integrate with (e.g., CRMs, ERPs, cloud storage, OCR tools)?
|
| 501 |
-
<client context>, Are there specific APIs, databases, or platforms already in use that we need to consider?
|
| 502 |
-
Security and Compliance:
|
| 503 |
-
<client context>, What security measures are required to protect the data processed by the application?
|
| 504 |
-
<client context>, Are there any industry-specific compliance standards the application must adhere to (e.g., GDPR, HIPAA)?
|
| 505 |
-
Scalability and Performance:
|
| 506 |
-
<client context>, What is the expected volume of documents the application should handle on a daily/weekly/monthly basis?
|
| 507 |
-
<client context>, Are there performance benchmarks or response time requirements that the application must meet?
|
| 508 |
-
User Management and Access Control:
|
| 509 |
-
<client context>, What user roles and permissions will be needed within the application?
|
| 510 |
-
<client context>, How should user authentication and authorization be managed?
|
| 511 |
-
Reporting and Analytics:
|
| 512 |
-
<client context>, What types of analytics or reporting capabilities do you require within the application?
|
| 513 |
-
<client context>, Do you need real-time reporting, or are batch processes sufficient?
|
| 514 |
-
Deployment and Maintenance:
|
| 515 |
-
<client context>, Do you have any preferences for the deployment environment (e.g., cloud-based, on-premises)?
|
| 516 |
-
<client context>, What are your requirements for application maintenance and support post-deployment?
|
| 517 |
-
|
| 518 |
-
Instructions:
|
| 519 |
-
Replace <client context> with relevant information derived from the provided client background.
|
| 520 |
-
Only provide the list of formatted questions without any additional introduction or summary.
|
| 521 |
-
""",
|
| 522 |
-
inputs=['project_detail'],
|
| 523 |
-
outputs=['gathered_project_input'],
|
| 524 |
-
model=ModelType.O1_MINI,
|
| 525 |
-
editable=True,
|
| 526 |
-
description="Generate context-aware list of question based on the project detail",
|
| 527 |
-
ui={
|
| 528 |
-
"input_editor": UIConfig(
|
| 529 |
-
component_type=UIComponentType.TEXTBOX,
|
| 530 |
-
label="Project Input",
|
| 531 |
-
lines=20,
|
| 532 |
-
interactive=True
|
| 533 |
-
),
|
| 534 |
-
"output_display": UIConfig(
|
| 535 |
-
component_type=UIComponentType.MARKDOWN,
|
| 536 |
-
label="Project Input Output",
|
| 537 |
-
interactive=False,
|
| 538 |
-
show_copy_button=True
|
| 539 |
-
)
|
| 540 |
-
}
|
| 541 |
-
),
|
| 542 |
-
|
| 543 |
-
"review_project_input": PromptConfig(
|
| 544 |
-
prompt=
|
| 545 |
-
"""
|
| 546 |
-
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.
|
| 547 |
-
Ensure questions are tailored, referencing prior context or statements for precision.
|
| 548 |
-
Requirements:
|
| 549 |
-
You need to FULLY read the input which is given below client background information.
|
| 550 |
-
Generate follow-up questions to identify missing details or ambiguities.
|
| 551 |
-
Use specific references to prior responses for continuity. For example: "You mentioned [context]. Can you elaborate on [specific aspect]?"
|
| 552 |
-
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?"
|
| 553 |
-
Highlight systemic issues where patterns emerge (e.g., manual processes across multiple challenges).
|
| 554 |
-
# Output Format:
|
| 555 |
-
<index><question>(sample answers)
|
| 556 |
-
Just return the formatted list as string and nothing else.
|
| 557 |
-
""",
|
| 558 |
-
inputs=['project_detail'],
|
| 559 |
-
outputs=['reviewed_project_input'],
|
| 560 |
-
model=ModelType.O1_MINI,
|
| 561 |
-
editable=True,
|
| 562 |
-
description="Review project input",
|
| 563 |
-
ui={
|
| 564 |
-
"input_editor": UIConfig(
|
| 565 |
-
component_type=UIComponentType.TEXTBOX,
|
| 566 |
-
label="Project Input",
|
| 567 |
-
lines=20,
|
| 568 |
-
interactive=True
|
| 569 |
-
),
|
| 570 |
-
"output_display": UIConfig(
|
| 571 |
-
component_type=UIComponentType.MARKDOWN,
|
| 572 |
-
label="Project Input Output",
|
| 573 |
-
interactive=False,
|
| 574 |
-
show_copy_button=True
|
| 575 |
-
)
|
| 576 |
-
}
|
| 577 |
-
),
|
| 578 |
-
|
| 579 |
"generate_BD_SOW": PromptConfig(
|
| 580 |
prompt=
|
| 581 |
"""
|
| 582 |
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:
|
| 583 |
-
|
| 584 |
### **Scope of Work (SOW)**
|
| 585 |
#### **1. Project Background**
|
| 586 |
- Provide a brief overview of the project, including the context, problem statement, and why the project is being initiated.
|
| 587 |
-
|
| 588 |
-
|
| 589 |
#### **2. Project Objective**
|
| 590 |
- Clearly define the project's primary goals and what constitutes success, using the following structure:
|
| 591 |
-
|
| 592 |
-
|
| 593 |
#### **3. Project Buyers & Stakeholders**
|
| 594 |
- List key stakeholders involved in the project, e.g. buyers, end-users, and decision-makers.
|
| 595 |
- Identify their name and roles in the project, using a tab
|
| 596 |
#### **4. System Flow**
|
| 597 |
- Provide description of how the system components interact, describing what each module does and how it works.
|
| 598 |
- Use one of the following:
|
| 599 |
-
|
| 600 |
-
|
| 601 |
- Use bullet point, ensure simplicity and avoid overly technical language
|
| 602 |
#### **5. Modules and Functional Requirements Breakdown**
|
| 603 |
- LEAVE THIS BLANK
|
| 604 |
#### **6. Acceptance Criteria**
|
| 605 |
- Define conditions to be met, including specific, measurable criteria for project completion:
|
| 606 |
-
|
| 607 |
-
|
| 608 |
-
|
| 609 |
-
|
| 610 |
#### **7. Assumptions and Pre-requisites**
|
| 611 |
- List all planning-phase assumptions and pre-requisites, grouped into:
|
| 612 |
-
|
| 613 |
-
|
| 614 |
-
|
| 615 |
-
|
| 616 |
-
|
| 617 |
-
|
| 618 |
-
|
| 619 |
#### **8. Proposed Timeline**
|
| 620 |
- Provide a project timeline, including:
|
| 621 |
-
|
| 622 |
-
|
| 623 |
-
|
| 624 |
- Use a Gantt chart or table to visualize the timeline.
|
| 625 |
- Ensure the output are clean, organized, and easy to read
|
| 626 |
#### **9. Commercial**
|
|
@@ -628,25 +631,25 @@ PROMPTS = {
|
|
| 628 |
- Development Fee: Create a table summarizing the costs for development, including the product, technical work supporting, or other additional services provided
|
| 629 |
- Subscription Fee: If applicable, create a table summarizing subscription fees for system usage.
|
| 630 |
- Payment Terms: Include a text description of payment terms:
|
| 631 |
-
|
| 632 |
-
|
| 633 |
-
|
| 634 |
- Output Format for tables: {Service}, {Fee} (leave amount blank)
|
| 635 |
#### **10. Sign-Off**
|
| 636 |
- Create a professional and formal Sign-Off section to acknowledge and approve the SOW.
|
| 637 |
-
|
| 638 |
-
|
| 639 |
-
|
| 640 |
-
|
| 641 |
-
|
| 642 |
-
|
| 643 |
#### **Guidelines**
|
| 644 |
- Use bullet points for clarity.
|
| 645 |
- Keep descriptions concise and client-friendly; avoid technical jargon unless necessary.
|
| 646 |
- Maintain structured sections and tables for readability.
|
| 647 |
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!
|
| 648 |
""",
|
| 649 |
-
inputs=["generated_prd", "generated_plan_test_components", "
|
| 650 |
outputs=["generated_BD_SOW"],
|
| 651 |
model=ModelType.O1_MINI,
|
| 652 |
description="Generate BD SOW",
|
|
@@ -677,51 +680,51 @@ PROMPTS = {
|
|
| 677 |
prompt=
|
| 678 |
"""
|
| 679 |
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:
|
| 680 |
-
|
| 681 |
### **Scope of Work (SOW)**
|
| 682 |
-
|
| 683 |
#### **1. Scope Summary**
|
| 684 |
- Provide a concise, high-level overview of the project scope. Divide it into three subsections:
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
| 691 |
-
|
| 692 |
-
|
| 693 |
-
|
| 694 |
#### **2. Modules and Functional Requirements Breakdown**
|
| 695 |
- Break down the project into modules or components.
|
| 696 |
- Prsent the details in a succinct and client-friendly table with the following column:
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
- Use clear, concise, non-technical language. (e.g., 'Drag-and-drop support for PDFs, Excel, CSV; progress indicators'). Avoid excessive detail.
|
| 701 |
-
|
| 702 |
#### **3. Out of Scope**
|
| 703 |
- Explicitly define what is excluded from the project's scope. This may include any functionalities, tasks, or deliverables.
|
| 704 |
- Ensure clarity to prevent future misunderstandings.
|
| 705 |
-
|
| 706 |
#### **4. System Flow**
|
| 707 |
- Provide a detailed, step-by-step description of how the system components interact.
|
| 708 |
- For each component or module:
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
Output Requirements:
|
| 714 |
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.
|
| 715 |
Use clear, concise, and client-friendly language. Avoid excessive technical jargon unless necessary.
|
| 716 |
Example JSON Output:
|
| 717 |
{
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
| 722 |
}
|
| 723 |
""",
|
| 724 |
-
inputs=["generated_plan_test_components", "
|
| 725 |
outputs=["generated_Tech_SOW"],
|
| 726 |
model=ModelType.O1_MINI,
|
| 727 |
description="Generate Test SOW",
|
|
@@ -751,11 +754,17 @@ PROMPTS = {
|
|
| 751 |
"analyze_planning_testing_mandays": PromptConfig(
|
| 752 |
prompt=
|
| 753 |
"""
|
| 754 |
-
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
|
| 755 |
-
|
| 756 |
Objective:
|
| 757 |
-
|
| 758 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 759 |
Output Format Requirements:
|
| 760 |
- Provide a clear list of identified priority planning/testing components with a brief justification for each selection.
|
| 761 |
- Ensure the output is concise and actionable.
|
|
@@ -763,11 +772,12 @@ PROMPTS = {
|
|
| 763 |
inputs=["generated_plan_test_mandays"],
|
| 764 |
outputs=["identified_planning_testing_components"],
|
| 765 |
model=ModelType.O1_MINI,
|
| 766 |
-
description="
|
|
|
|
| 767 |
ui={
|
| 768 |
"planning_testing_prompt_editor": UIConfig(
|
| 769 |
component_type=UIComponentType.TEXTBOX,
|
| 770 |
-
label="
|
| 771 |
lines=20,
|
| 772 |
interactive=True
|
| 773 |
),
|
|
@@ -777,24 +787,34 @@ PROMPTS = {
|
|
| 777 |
"analyze_development_mandays": PromptConfig(
|
| 778 |
prompt=
|
| 779 |
"""
|
| 780 |
-
You are an experienced project manager tasked with analyzing the provided development mandays estimates. Your goal is to identify the highest priority components that must be completed to build the MVP
|
| 781 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 782 |
Objective:
|
| 783 |
-
Generate a list of the top development components that will deliver the most value with the least effort, focusing on those that are
|
| 784 |
-
|
| 785 |
Output Format Requirements:
|
| 786 |
- Provide a clear list of identified priority development components with a brief justification for each selection.
|
| 787 |
- Ensure the output is concise and actionable.
|
| 788 |
-
|
|
|
|
|
|
|
|
|
|
| 789 |
""",
|
| 790 |
inputs=["generated_dev_mandays"],
|
| 791 |
outputs=["identified_development_components"],
|
| 792 |
model=ModelType.O1_MINI,
|
| 793 |
-
description="
|
|
|
|
| 794 |
ui={
|
| 795 |
"development_prompt_editor": UIConfig(
|
| 796 |
component_type=UIComponentType.TEXTBOX,
|
| 797 |
-
label="Development Components Analysis",
|
| 798 |
lines=20,
|
| 799 |
interactive=True
|
| 800 |
),
|
|
@@ -804,31 +824,37 @@ PROMPTS = {
|
|
| 804 |
"recalculate_mandays": PromptConfig(
|
| 805 |
prompt=
|
| 806 |
"""
|
| 807 |
-
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 (
|
| 808 |
-
|
| 809 |
Objective:
|
| 810 |
-
|
| 811 |
-
|
| 812 |
-
|
| 813 |
-
|
| 814 |
-
|
| 815 |
-
|
| 816 |
-
-
|
| 817 |
-
-
|
| 818 |
-
-
|
| 819 |
-
|
|
|
|
|
|
|
|
|
|
| 820 |
Output Format Requirements:
|
| 821 |
-
|
| 822 |
-
-
|
|
|
|
|
|
|
| 823 |
""",
|
| 824 |
inputs=["identified_priority_components", "generated_prd"],
|
| 825 |
outputs=["revised_mandays_estimates"],
|
| 826 |
model=ModelType.O1_MINI,
|
| 827 |
-
description="Recalculate
|
|
|
|
| 828 |
ui={
|
| 829 |
"mandays_recalculation_prompt_editor": UIConfig(
|
| 830 |
component_type=UIComponentType.TEXTBOX,
|
| 831 |
-
label="Mandays Recalculation",
|
| 832 |
lines=20,
|
| 833 |
interactive=True
|
| 834 |
)
|
|
@@ -839,19 +865,19 @@ PROMPTS = {
|
|
| 839 |
prompt=
|
| 840 |
"""
|
| 841 |
Using the revised mandays estimates from the previous step, format the output into two clearly separated CSV sections: one for Planning/Testing Priority Components and another for Development Priority Components.
|
| 842 |
-
|
| 843 |
Objective:
|
| 844 |
Structure the output to clearly delineate the two sections while maintaining the original column structure.
|
| 845 |
-
|
| 846 |
Output Format Requirements:
|
| 847 |
- First Section - Planning & Testing Priority Components:
|
| 848 |
-
|
| 849 |
-
|
| 850 |
-
|
| 851 |
- Second Section - Development Priority Components:
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
Important:
|
| 856 |
- Each section must maintain its original column structure.
|
| 857 |
- Sections MUST be separated by the marker: "---SECTION BREAK---".
|
|
@@ -859,7 +885,7 @@ PROMPTS = {
|
|
| 859 |
- No empty rows or missing values.
|
| 860 |
- Text values must be in double quotes.
|
| 861 |
- Numbers must not be in quotes.
|
| 862 |
-
|
| 863 |
Return only the CSV content with the section break, no additional text or explanations.
|
| 864 |
""",
|
| 865 |
inputs=["revised_mandays_estimates"],
|
|
|
|
| 11 |
MARKDOWN = "markdown"
|
| 12 |
DATAFRAME = "dataframe"
|
| 13 |
BUTTON = "button"
|
| 14 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
@dataclass
|
| 17 |
class UIConfig:
|
|
|
|
| 31 |
inputs: List[str]
|
| 32 |
outputs: List[str]
|
| 33 |
model: ModelType
|
|
|
|
| 34 |
description: str = ""
|
| 35 |
step: str = ""
|
| 36 |
ui: Dict[str, UIConfig] = None
|
|
|
|
| 65 |
inputs=[],
|
| 66 |
outputs=[],
|
| 67 |
model=ModelType.O1_MINI,
|
| 68 |
+
description="Client Initial Question",
|
| 69 |
+
step="Chatbot Prompt Editors",
|
| 70 |
ui={
|
| 71 |
+
"client_initial_question_prompt_editor": UIConfig(
|
| 72 |
component_type=UIComponentType.TEXTBOX,
|
| 73 |
+
label="Client Initial Questions",
|
| 74 |
+
interactive=True,
|
| 75 |
+
lines=20
|
| 76 |
)
|
| 77 |
}
|
| 78 |
),
|
|
|
|
| 112 |
inputs=['project_detail'],
|
| 113 |
outputs=['client_follow_up_questions'],
|
| 114 |
model=ModelType.O1_MINI,
|
| 115 |
+
description="Generate Client Follow-up Questions",
|
| 116 |
+
step="Chatbot Prompt Editors",
|
| 117 |
ui={
|
| 118 |
+
"client_follow_up_quetions_prompt_editor": UIConfig(
|
| 119 |
+
component_type=UIComponentType.TEXTBOX,
|
| 120 |
+
label="Client Follow-up Questions",
|
| 121 |
+
interactive=True,
|
| 122 |
+
lines=20
|
| 123 |
)
|
| 124 |
}
|
| 125 |
),
|
| 126 |
|
| 127 |
+
"follow_up_question_generator": PromptConfig(
|
| 128 |
prompt=
|
| 129 |
"""
|
| 130 |
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.
|
|
|
|
| 150 |
inputs=['generated_prd'],
|
| 151 |
outputs=['follow_up_questions'],
|
| 152 |
model=ModelType.O1_MINI,
|
| 153 |
+
description="Generate Follow-up Questions",
|
| 154 |
+
step="Chatbot Prompt Editors",
|
| 155 |
ui={
|
| 156 |
+
"follow_up_questions_prompt_editor": UIConfig(
|
| 157 |
+
component_type=UIComponentType.TEXTBOX,
|
| 158 |
label="Follow-up Questions",
|
| 159 |
+
interactive=True,
|
| 160 |
+
lines=20
|
| 161 |
+
)
|
| 162 |
+
}
|
| 163 |
+
),
|
| 164 |
+
|
| 165 |
+
"gather_project_input": PromptConfig(
|
| 166 |
+
prompt=
|
| 167 |
+
"""
|
| 168 |
+
**You are a Software Development Expert specializing in scalable, secure, and robust document processing systems.
|
| 169 |
+
You will be provided with client background information.
|
| 170 |
+
Your task is to create a dynamic, context-aware list of questions to collaboratively gather client requirements for a document processing application.
|
| 171 |
+
Use the list below as a baseline. Generate additional, relevant questions on top of this baseline where appropriate.
|
| 172 |
+
Use the client's context to add clarity or relevance to the question.
|
| 173 |
+
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.
|
| 174 |
+
### Areas to Cover:
|
| 175 |
+
---
|
| 176 |
+
Document Types:
|
| 177 |
+
<client context>, What specific types of documents will the application need to process (e.g., invoices, legal contracts, ID forms)?
|
| 178 |
+
<client context>, Are there specific complexities or variations in these documents that we should account for (e.g., multi-page documents, handwritten content)?
|
| 179 |
+
Inputs and Outputs:
|
| 180 |
+
<client context>, What are the expected input formats (e.g., PDFs, images, scanned documents)?
|
| 181 |
+
<client context>, What should the processed outputs look like (e.g., structured data, summaries, reports)?
|
| 182 |
+
<client context>, Are there any specific formatting requirements for outputs?
|
| 183 |
+
Document Quality:
|
| 184 |
+
<client context>, Are the documents typically clean and structured, or will the application need preprocessing capabilities (e.g., OCR, noise reduction)?
|
| 185 |
+
<client context>, Do you foresee any challenges with document quality, such as low resolution or inconsistent formatting?
|
| 186 |
+
Workflow Mapping:
|
| 187 |
+
<client context>, Can you describe your current document processing workflow?
|
| 188 |
+
<client context>, What are the major pain points or inefficiencies in the current process?
|
| 189 |
+
<client context>, Which parts of the workflow involve manual interventions, and how would you like to streamline them?
|
| 190 |
+
Integration Points:
|
| 191 |
+
<client context>, What existing systems or third-party tools does the application need to integrate with (e.g., CRMs, ERPs, cloud storage, OCR tools)?
|
| 192 |
+
<client context>, Are there specific APIs, databases, or platforms already in use that we need to consider?
|
| 193 |
+
Security and Compliance:
|
| 194 |
+
<client context>, What security measures are required to protect the data processed by the application?
|
| 195 |
+
<client context>, Are there any industry-specific compliance standards the application must adhere to (e.g., GDPR, HIPAA)?
|
| 196 |
+
Scalability and Performance:
|
| 197 |
+
<client context>, What is the expected volume of documents the application should handle on a daily/weekly/monthly basis?
|
| 198 |
+
<client context>, Are there performance benchmarks or response time requirements that the application must meet?
|
| 199 |
+
User Management and Access Control:
|
| 200 |
+
<client context>, What user roles and permissions will be needed within the application?
|
| 201 |
+
<client context>, How should user authentication and authorization be managed?
|
| 202 |
+
Reporting and Analytics:
|
| 203 |
+
<client context>, What types of analytics or reporting capabilities do you require within the application?
|
| 204 |
+
<client context>, Do you need real-time reporting, or are batch processes sufficient?
|
| 205 |
+
Deployment and Maintenance:
|
| 206 |
+
<client context>, Do you have any preferences for the deployment environment (e.g., cloud-based, on-premises)?
|
| 207 |
+
<client context>, What are your requirements for application maintenance and support post-deployment?
|
| 208 |
+
|
| 209 |
+
Instructions:
|
| 210 |
+
Replace <client context> with relevant information derived from the provided client background.
|
| 211 |
+
Only provide the list of formatted questions without any additional introduction or summary.
|
| 212 |
+
""",
|
| 213 |
+
inputs=['project_detail'],
|
| 214 |
+
outputs=['gathered_project_input'],
|
| 215 |
+
model=ModelType.O1_MINI,
|
| 216 |
+
description="Generate Context-Aware List Of Questions",
|
| 217 |
+
step="Chatbot Prompt Editors",
|
| 218 |
+
ui={
|
| 219 |
+
"gather_project_input_prompt_editor": UIConfig(
|
| 220 |
+
component_type=UIComponentType.TEXTBOX,
|
| 221 |
+
label="Gather Project Input Prompt",
|
| 222 |
+
lines=20,
|
| 223 |
+
interactive=True
|
| 224 |
+
)
|
| 225 |
+
}
|
| 226 |
+
),
|
| 227 |
+
|
| 228 |
+
"review_project_input": PromptConfig(
|
| 229 |
+
prompt=
|
| 230 |
+
"""
|
| 231 |
+
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.
|
| 232 |
+
Ensure questions are tailored, referencing prior context or statements for precision.
|
| 233 |
+
Requirements:
|
| 234 |
+
You need to FULLY read the input which is given below client background information.
|
| 235 |
+
Generate follow-up questions to identify missing details or ambiguities.
|
| 236 |
+
Use specific references to prior responses for continuity. For example: "You mentioned [context]. Can you elaborate on [specific aspect]?"
|
| 237 |
+
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?"
|
| 238 |
+
Highlight systemic issues where patterns emerge (e.g., manual processes across multiple challenges).
|
| 239 |
+
# Output Format:
|
| 240 |
+
<index><question>(sample answers)
|
| 241 |
+
Just return the formatted list as string and nothing else.
|
| 242 |
+
""",
|
| 243 |
+
inputs=['project_detail'],
|
| 244 |
+
outputs=['reviewed_project_input'],
|
| 245 |
+
model=ModelType.O1_MINI,
|
| 246 |
+
description="Review project input",
|
| 247 |
+
step="Chatbot Prompt Editors",
|
| 248 |
+
ui={
|
| 249 |
+
"review_project_input_prompt_editor": UIConfig(
|
| 250 |
+
component_type=UIComponentType.TEXTBOX,
|
| 251 |
+
label="Review Project Input Prompt",
|
| 252 |
+
lines=20,
|
| 253 |
+
interactive=True
|
| 254 |
)
|
| 255 |
}
|
| 256 |
),
|
|
|
|
| 259 |
prompt=
|
| 260 |
"""
|
| 261 |
Rewrite this for clarity while keeping ALL specific details, metrics, and constraints.
|
| 262 |
+
Please take note of the time constraint to build the MVP.
|
| 263 |
+
Do not include context or assumptions beyond the input provided.
|
| 264 |
+
Do not also exclude any input provided.
|
| 265 |
+
Structure the document to ensure clarity and logical flow.
|
| 266 |
+
Make sure to make the title "Project Requirements".
|
| 267 |
""",
|
| 268 |
inputs=["project_detail"],
|
| 269 |
outputs=["generated_prd"],
|
|
|
|
| 292 |
}
|
| 293 |
),
|
| 294 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
"generate_plan_test_components": PromptConfig(
|
| 296 |
prompt=
|
| 297 |
"""
|
| 298 |
Context:
|
| 299 |
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).
|
| 300 |
+
|
| 301 |
Instructions:
|
| 302 |
Break the project into the following phases:
|
| 303 |
+
1. Planning Phase ( Potention Focus: Requirement gathering,Technical architecture design, Resource Allocation.. etc)
|
| 304 |
2. Testing Phase ( Potention Focus: Integration testing, System testing, User Acceptance Testing (UAT) )
|
| 305 |
+
|
| 306 |
Components:
|
| 307 |
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.
|
| 308 |
Use the PRD to extract relevant, granular components that reflect deliverables unique to this project.
|
| 309 |
+
|
| 310 |
Output Format:
|
| 311 |
Use bullet points for clarity and ensure each component is concise yet descriptive.
|
| 312 |
Include sub-bullets for tasks or subcomponents where necessary to provide additional detail.
|
|
|
|
| 341 |
"generate_dev_components": PromptConfig(
|
| 342 |
prompt=
|
| 343 |
"""
|
| 344 |
+
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.
|
| 345 |
+
|
| 346 |
+
**Specific Requirements:**
|
| 347 |
+
1. Extract relevant **granular components** from the PRD that reflect the tasks and deliverables unique to this project.
|
| 348 |
+
2. Components should directly reference functionalities or deliverables related to the project.
|
| 349 |
+
3. Prioritize components that provide high business value, such as core functionality.
|
| 350 |
+
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.
|
| 351 |
+
5. Ensure deliverables focus entirely on outcomes and deliverables, and consider edge cases, avoiding unnecessary instructions (i.e., avoid filler words).
|
| 352 |
+
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.
|
| 353 |
+
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.
|
| 354 |
+
|
| 355 |
+
**Output Format:**
|
| 356 |
- Title: Component Name as Table Title (e.g., "Frontend Components")
|
| 357 |
- Table Structure:
|
| 358 |
+
- **Subcomponent**: Subcomponent name (e.g., "User Authentication and Authorization").
|
| 359 |
+
- **Task**: Task name (e.g., "Login Interface").
|
| 360 |
+
- **Deliverables**: Lists of technical outcomes or deliverables (e.g., "1. Deliverable 1 2. Deliverable 2 3. Deliverable ..."), as much as possible.
|
| 361 |
+
- **Special Edge Cases Considerations**: A separate table to address unhappy paths, with the same structure as above.
|
| 362 |
+
|
| 363 |
+
**Example:**
|
| 364 |
Frontend Component
|
| 365 |
+
| **Component** | **Task** | **Deliverables** |
|
| 366 |
+
|--------------------------------|------------------------------|----------------------------------------------------------------------------------------------------------|
|
| 367 |
+
| Document Upload Interface | Implement File Upload | 1. React-based file upload component<br>2. Drag-and-drop functionality<br>3. Progress bar for uploads |
|
| 368 |
+
|
| 369 |
+
**Special Edge Cases Considerations**
|
| 370 |
+
| **Component** | **Task** | **Deliverables** |
|
| 371 |
+
|--------------------------------|------------------------------|----------------------------------------------------------------------------------------------------------|
|
| 372 |
+
| Input Validation | Handle Invalid Inputs | 1. File format validation logic<br>2. File size validation logic<br>3. Error messaging UI for invalid inputs |
|
| 373 |
+
|
| 374 |
+
**Tech Stack:**
|
| 375 |
+
- Backend: FastAPI, Python
|
| 376 |
+
- Frontend: React
|
| 377 |
+
- Infrastructure: AWS, PostgreSQL, Redis, Docker, Alembic
|
| 378 |
+
|
| 379 |
+
**Objective:**
|
| 380 |
+
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.
|
| 381 |
""",
|
| 382 |
inputs=["generated_prd"],
|
| 383 |
outputs=["generated_dev_components"],
|
|
|
|
| 405 |
)
|
| 406 |
}
|
| 407 |
),
|
| 408 |
+
|
| 409 |
+
"reformat_dev_components": PromptConfig(
|
| 410 |
+
prompt=
|
| 411 |
+
"""
|
| 412 |
+
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).
|
| 413 |
+
|
| 414 |
+
**Specific Requirements:**
|
| 415 |
+
1. **Standardize Naming Conventions**:
|
| 416 |
+
- Use **descriptive and intuitive names** for components, subcomponents, tasks, and deliverables.
|
| 417 |
+
- Ensure naming is **consistent across all tables** (Frontend, Backend, Integration, Infrastructure, Database, and Special Edge Cases).
|
| 418 |
+
- Avoid overly technical jargon unless necessary for clarity.
|
| 419 |
+
- Use **action-oriented language** for tasks and deliverables (e.g., "Implement file upload functionality" instead of "File upload functionality").
|
| 420 |
+
|
| 421 |
+
2. **Common Web Development Document Extraction Components**:
|
| 422 |
+
- Include standard components such as:
|
| 423 |
+
- **Document Upload Interface**
|
| 424 |
+
- **Document Processing Engine**
|
| 425 |
+
- **Data Validation Module**
|
| 426 |
+
- **OCR Integration**
|
| 427 |
+
- **Data Reconciliation Module**
|
| 428 |
+
- **Report Generation Interface**
|
| 429 |
+
- **User Authentication and Authorization**
|
| 430 |
+
- **Notification and Alert System**
|
| 431 |
+
- **API Integrations**
|
| 432 |
+
- **Database Schema Design**
|
| 433 |
+
- **Error Handling and Logging**
|
| 434 |
+
- **Scalability and Load Balancing**
|
| 435 |
+
|
| 436 |
+
3. **Reformat the Generated Components**:
|
| 437 |
+
- Ensure all components, subcomponents, tasks, and deliverables follow the standardized naming conventions.
|
| 438 |
+
- Group related tasks and deliverables under the appropriate subcomponents.
|
| 439 |
+
- Maintain a clean and logical structure for readability and technical usability.
|
| 440 |
+
|
| 441 |
+
**Output Format:**
|
| 442 |
+
- Title: Component Name as Table Title (e.g., "Frontend Components")
|
| 443 |
+
- Table Structure:
|
| 444 |
+
- **Subcomponent**: Subcomponent name (e.g., "Document Upload Interface").
|
| 445 |
+
- **Task**: Task name (e.g., "Implement file upload functionality").
|
| 446 |
+
- **Deliverables**: Lists of technical outcomes or deliverables
|
| 447 |
+
""",
|
| 448 |
+
inputs=["generated_dev_components"],
|
| 449 |
+
outputs=["reformatted_dev_components"],
|
| 450 |
+
model=ModelType.O1_MINI,
|
| 451 |
+
description="Reformat development components",
|
| 452 |
+
step="Step 1 : Scope & Components",
|
| 453 |
+
ui={
|
| 454 |
+
"reformatted_dev_components_prompt_editor": UIConfig(
|
| 455 |
+
component_type=UIComponentType.TEXTBOX,
|
| 456 |
+
label="Reformatted Development Components",
|
| 457 |
+
lines=20,
|
| 458 |
+
interactive=True
|
| 459 |
+
),
|
| 460 |
+
"reformatted_dev_components_text": UIConfig(
|
| 461 |
+
component_type=UIComponentType.TEXTBOX,
|
| 462 |
+
label="Reformatted Development Components Output",
|
| 463 |
+
lines=20,
|
| 464 |
+
visible=True
|
| 465 |
+
),
|
| 466 |
+
"reformatted_dev_components_markdown": UIConfig(
|
| 467 |
+
component_type=UIComponentType.MARKDOWN,
|
| 468 |
+
label="Reformatted Development Components Markdown Output",
|
| 469 |
+
visible=True,
|
| 470 |
+
show_copy_button=True
|
| 471 |
+
)
|
| 472 |
+
}
|
| 473 |
+
),
|
| 474 |
|
| 475 |
"generate_plan_test_mandays": PromptConfig(
|
| 476 |
prompt=
|
| 477 |
"""
|
| 478 |
You are an experienced project manager tasked to create a detailed task breakdown for a project based on the planning and testing component list.
|
| 479 |
+
|
| 480 |
Objective:
|
| 481 |
Generate a structured CSV output with manday estimates for each planning and testing component.
|
| 482 |
+
|
| 483 |
Instructions:
|
| 484 |
1. Use the planning and testing component list to identify all components
|
| 485 |
2. For each component:
|
| 486 |
+
- Estimate mandays between 0.2 and 5 days based on real-world complexity
|
| 487 |
+
- Provide a clear description of deliverables and outcomes
|
| 488 |
+
- Ensure estimates account for potential delays or complications
|
| 489 |
+
|
| 490 |
Output Format Requirements:
|
| 491 |
- Generate a CSV with EXACTLY these column headers: "component,mandays,description"
|
| 492 |
- Each row must have all three columns filled
|
| 493 |
- Numeric values should not be quoted
|
| 494 |
- Text values must be enclosed in double quotes
|
| 495 |
- No empty rows or missing values
|
| 496 |
+
|
| 497 |
Example Output:
|
| 498 |
component,mandays,description
|
| 499 |
"Project Planning",2.5,"Detailed project planning including timeline and resource allocation"
|
| 500 |
"Requirements Analysis",1.5,"Analysis and documentation of system requirements"
|
| 501 |
+
|
| 502 |
Return only the CSV content, no code blocks or additional text.
|
| 503 |
""",
|
| 504 |
inputs=["generated_plan_test_components"],
|
|
|
|
| 525 |
prompt=
|
| 526 |
"""
|
| 527 |
You are an experienced project manager tasked to create a detailed task breakdown for development components.
|
| 528 |
+
|
|
|
|
| 529 |
Objective:
|
| 530 |
Generate a structured CSV output with manday estimates for each development component and subcomponent from the provided development component list.
|
| 531 |
+
|
| 532 |
Critical CSV Format Requirements:
|
| 533 |
1. First line MUST be exactly: component,subcomponent,mandays,description
|
| 534 |
2. Each subsequent line MUST contain actual data with:
|
| 535 |
+
- component: quoted text (e.g., "Frontend", "Backend")
|
| 536 |
+
- subcomponent: quoted text (e.g., "User Authentication", "API Development")
|
| 537 |
+
- mandays: unquoted number between 0.5 and 7 (e.g., 3.5, 2.0)
|
| 538 |
+
- description: quoted text describing the work
|
| 539 |
3. No empty lines or missing values
|
| 540 |
4. Text values must be in double quotes
|
| 541 |
5. Numbers must not be in quotes
|
| 542 |
+
|
| 543 |
Example Valid Output:
|
| 544 |
component,subcomponent,mandays,description
|
| 545 |
"Frontend","User Authentication",3.5,"Implementation of login/logout functionality with security features"
|
|
|
|
| 548 |
"Backend","Database Integration",2,"Implementation of database connections and queries"
|
| 549 |
"Infrastructure","Docker Setup",1.5,"Container configuration and deployment setup"
|
| 550 |
"Infrastructure","CI/CD Pipeline",2,"Setup of automated build and deployment pipeline"
|
| 551 |
+
|
| 552 |
Instructions:
|
| 553 |
1. Parse the provided development component list
|
| 554 |
2. For EACH component and subcomponent in the list:
|
| 555 |
+
- Create at least one row in the CSV
|
| 556 |
+
- Estimate realistic mandays (0.5-7 days)
|
| 557 |
+
- Write clear descriptions
|
| 558 |
3. Return ONLY the CSV content - no explanations or code blocks
|
| 559 |
+
|
| 560 |
YOU MUST GENERATE ACTUAL DATA ROWS based on the development component list provided.
|
| 561 |
""",
|
| 562 |
+
inputs=["reformatted_dev_components"],
|
| 563 |
outputs=["generated_dev_mandays"],
|
| 564 |
model=ModelType.O1_MINI,
|
| 565 |
description="Generate development mandays",
|
|
|
|
| 579 |
}
|
| 580 |
),
|
| 581 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 582 |
"generate_BD_SOW": PromptConfig(
|
| 583 |
prompt=
|
| 584 |
"""
|
| 585 |
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:
|
| 586 |
+
|
| 587 |
### **Scope of Work (SOW)**
|
| 588 |
#### **1. Project Background**
|
| 589 |
- Provide a brief overview of the project, including the context, problem statement, and why the project is being initiated.
|
| 590 |
+
- Break down key challenges (in bullet point) the company currently facing, quantifying the impacts where possible (e.g., lost revenue, downtime).
|
| 591 |
+
- Close this section with industry trends or other relevant background information, emphasizing risks of inaction leading to the project, in 2-3 sentenc
|
| 592 |
#### **2. Project Objective**
|
| 593 |
- Clearly define the project's primary goals and what constitutes success, using the following structure:
|
| 594 |
+
- Goals: List specific, measurable goals (e.g., reduce processing time by 20%).
|
| 595 |
+
- Outcomes: Describe tangible deliverables and metrics for succe
|
| 596 |
#### **3. Project Buyers & Stakeholders**
|
| 597 |
- List key stakeholders involved in the project, e.g. buyers, end-users, and decision-makers.
|
| 598 |
- Identify their name and roles in the project, using a tab
|
| 599 |
#### **4. System Flow**
|
| 600 |
- Provide description of how the system components interact, describing what each module does and how it works.
|
| 601 |
- Use one of the following:
|
| 602 |
+
- Visual Representation: Diagram illustrating workflows or data flows between modules.
|
| 603 |
+
- Textual Description: Detailed explanation of the processes and transitions
|
| 604 |
- Use bullet point, ensure simplicity and avoid overly technical language
|
| 605 |
#### **5. Modules and Functional Requirements Breakdown**
|
| 606 |
- LEAVE THIS BLANK
|
| 607 |
#### **6. Acceptance Criteria**
|
| 608 |
- Define conditions to be met, including specific, measurable criteria for project completion:
|
| 609 |
+
- Link each deliverable/module to its validation or testing process (e.g., UAT).
|
| 610 |
+
- Table format with the following column:
|
| 611 |
+
- Deliverable (e.g. Field Matching Automation module)
|
| 612 |
+
- Criteria, starting with "able to" (e.g. able to extract, match, and change the case status according
|
| 613 |
#### **7. Assumptions and Pre-requisites**
|
| 614 |
- List all planning-phase assumptions and pre-requisites, grouped into:
|
| 615 |
+
- Assumptions: Detailed, scenario-based assumptions that the project relies on. Each assumption should:
|
| 616 |
+
- Reference specific stakeholders (e.g., PWT staff, Mindhive).
|
| 617 |
+
- Describe specific conditions or expectations (e.g., document quality, workflow stability).
|
| 618 |
+
- Be written in clear, concise language.
|
| 619 |
+
- Pre-requisites or dependencies: Conditions that must be met before the project can proceed. Each pre-requisite should:
|
| 620 |
+
- Be specific and actionable.
|
| 621 |
+
- Reference who is responsible and what needs to be do
|
| 622 |
#### **8. Proposed Timeline**
|
| 623 |
- Provide a project timeline, including:
|
| 624 |
+
- Milestone
|
| 625 |
+
- Expected Date/Duration
|
| 626 |
+
- Outcome/Deliverable
|
| 627 |
- Use a Gantt chart or table to visualize the timeline.
|
| 628 |
- Ensure the output are clean, organized, and easy to read
|
| 629 |
#### **9. Commercial**
|
|
|
|
| 631 |
- Development Fee: Create a table summarizing the costs for development, including the product, technical work supporting, or other additional services provided
|
| 632 |
- Subscription Fee: If applicable, create a table summarizing subscription fees for system usage.
|
| 633 |
- Payment Terms: Include a text description of payment terms:
|
| 634 |
+
- Milestones: Specify at which stages payments are due
|
| 635 |
+
- Invoicing: Define invoicing intervals (e.g., monthly, quarterly) and payment deadlines
|
| 636 |
+
- Other Terms: Mention late payment fees or additional terms, if applicable
|
| 637 |
- Output Format for tables: {Service}, {Fee} (leave amount blank)
|
| 638 |
#### **10. Sign-Off**
|
| 639 |
- Create a professional and formal Sign-Off section to acknowledge and approve the SOW.
|
| 640 |
+
- Include an statement to clearly communicate that both parties have reviewed and agreed to the SOW.
|
| 641 |
+
- Provide placeholder for each party (Company):
|
| 642 |
+
- Signature
|
| 643 |
+
- Name
|
| 644 |
+
- Position
|
| 645 |
+
- Date
|
| 646 |
#### **Guidelines**
|
| 647 |
- Use bullet points for clarity.
|
| 648 |
- Keep descriptions concise and client-friendly; avoid technical jargon unless necessary.
|
| 649 |
- Maintain structured sections and tables for readability.
|
| 650 |
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!
|
| 651 |
""",
|
| 652 |
+
inputs=["generated_prd", "generated_plan_test_components", "reformatted_dev_components", "quotation_cost"],
|
| 653 |
outputs=["generated_BD_SOW"],
|
| 654 |
model=ModelType.O1_MINI,
|
| 655 |
description="Generate BD SOW",
|
|
|
|
| 680 |
prompt=
|
| 681 |
"""
|
| 682 |
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:
|
| 683 |
+
|
| 684 |
### **Scope of Work (SOW)**
|
| 685 |
+
|
| 686 |
#### **1. Scope Summary**
|
| 687 |
- Provide a concise, high-level overview of the project scope. Divide it into three subsections:
|
| 688 |
+
- In Scope:
|
| 689 |
+
- List all deliverables, functionalities, and modules included in the project.
|
| 690 |
+
- Be specific about what will be developed, implemented, or delivered.
|
| 691 |
+
- Assumptions:
|
| 692 |
+
- Highlight key project-specific assumptions that the project relies on.
|
| 693 |
+
- Dependencies:
|
| 694 |
+
- List all internal and external dependencies required for the project's success.
|
| 695 |
+
- Include any third-party integrations, resources, or timelines that the project depends on.
|
| 696 |
+
|
| 697 |
#### **2. Modules and Functional Requirements Breakdown**
|
| 698 |
- Break down the project into modules or components.
|
| 699 |
- Prsent the details in a succinct and client-friendly table with the following column:
|
| 700 |
+
- Module
|
| 701 |
+
ii. Functionalities/Features
|
| 702 |
+
iii. Notes for any special considerations or constraints (e.g., 'Supports files up to 100MB').
|
| 703 |
- Use clear, concise, non-technical language. (e.g., 'Drag-and-drop support for PDFs, Excel, CSV; progress indicators'). Avoid excessive detail.
|
| 704 |
+
|
| 705 |
#### **3. Out of Scope**
|
| 706 |
- Explicitly define what is excluded from the project's scope. This may include any functionalities, tasks, or deliverables.
|
| 707 |
- Ensure clarity to prevent future misunderstandings.
|
| 708 |
+
|
| 709 |
#### **4. System Flow**
|
| 710 |
- Provide a detailed, step-by-step description of how the system components interact.
|
| 711 |
- For each component or module:
|
| 712 |
+
- Describe what it does and how it works, including both success and unsuccessful scenarios
|
| 713 |
+
- Explain how it interacts with other components
|
| 714 |
+
|
| 715 |
+
|
| 716 |
Output Requirements:
|
| 717 |
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.
|
| 718 |
Use clear, concise, and client-friendly language. Avoid excessive technical jargon unless necessary.
|
| 719 |
Example JSON Output:
|
| 720 |
{
|
| 721 |
+
"scope_summary": <markdown content>,
|
| 722 |
+
"modules_and_functional_requirements": <markdown content>,
|
| 723 |
+
"out_of_scope": <markdown content>,
|
| 724 |
+
"system_flow": <markdown content>
|
| 725 |
}
|
| 726 |
""",
|
| 727 |
+
inputs=["generated_plan_test_components", "reformatted_dev_components"],
|
| 728 |
outputs=["generated_Tech_SOW"],
|
| 729 |
model=ModelType.O1_MINI,
|
| 730 |
description="Generate Test SOW",
|
|
|
|
| 754 |
"analyze_planning_testing_mandays": PromptConfig(
|
| 755 |
prompt=
|
| 756 |
"""
|
| 757 |
+
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.
|
| 758 |
+
|
| 759 |
Objective:
|
| 760 |
+
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.
|
| 761 |
+
|
| 762 |
+
Key Guidelines:
|
| 763 |
+
- Focus on Core Functionality: Only include components that are essential for the MVP to function and deliver immediate value to users.
|
| 764 |
+
- 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.
|
| 765 |
+
- Prioritize Business Value: Ensure the selected components align with the business's core objectives and deliver measurable value.
|
| 766 |
+
- Minimalistic Approach: Focus on the least effort required to deliver the most value.
|
| 767 |
+
|
| 768 |
Output Format Requirements:
|
| 769 |
- Provide a clear list of identified priority planning/testing components with a brief justification for each selection.
|
| 770 |
- Ensure the output is concise and actionable.
|
|
|
|
| 772 |
inputs=["generated_plan_test_mandays"],
|
| 773 |
outputs=["identified_planning_testing_components"],
|
| 774 |
model=ModelType.O1_MINI,
|
| 775 |
+
description="Plan & Test Components Analysis",
|
| 776 |
+
step="Step 2 : Planning & Testing Mandays",
|
| 777 |
ui={
|
| 778 |
"planning_testing_prompt_editor": UIConfig(
|
| 779 |
component_type=UIComponentType.TEXTBOX,
|
| 780 |
+
label="Plan & Test Components Analysis Prompt",
|
| 781 |
lines=20,
|
| 782 |
interactive=True
|
| 783 |
),
|
|
|
|
| 787 |
"analyze_development_mandays": PromptConfig(
|
| 788 |
prompt=
|
| 789 |
"""
|
| 790 |
+
You are an experienced project manager tasked with analyzing the provided development mandays estimates. Your goal is to identify the highest priority components that must be completed to build the MVP. Focus exclusively on components that deliver immediate value to users and are critical for the core functionality of the product.
|
| 791 |
+
|
| 792 |
+
Key Guidelines:
|
| 793 |
+
- Focus on Core Functionality: Only include components that are essential for the MVP to function and deliver immediate value to users.
|
| 794 |
+
- 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.
|
| 795 |
+
- Prioritize Business Value: Ensure the selected components align with the business's core objectives and deliver measurable value.
|
| 796 |
+
- Minimalistic Approach: Focus on the least effort required to deliver the most value.
|
| 797 |
+
|
| 798 |
Objective:
|
| 799 |
+
Generate a list of the top development components that will deliver the most value with the least effort, focusing on those that are essential for the MVP's core functionality. Ensure the output is concise and actionable.
|
| 800 |
+
|
| 801 |
Output Format Requirements:
|
| 802 |
- Provide a clear list of identified priority development components with a brief justification for each selection.
|
| 803 |
- Ensure the output is concise and actionable.
|
| 804 |
+
|
| 805 |
+
Important Notes:
|
| 806 |
+
- If a component is not directly tied to the core functionality or can be deferred to a later phase, exclude it from the list.
|
| 807 |
+
- Do not include any components related to authentication, security, compliance, or scalability unless they are absolutely necessary for the MVP to function.
|
| 808 |
""",
|
| 809 |
inputs=["generated_dev_mandays"],
|
| 810 |
outputs=["identified_development_components"],
|
| 811 |
model=ModelType.O1_MINI,
|
| 812 |
+
description="Development Components Analysis",
|
| 813 |
+
step="Step 2 : Planning & Testing Mandays",
|
| 814 |
ui={
|
| 815 |
"development_prompt_editor": UIConfig(
|
| 816 |
component_type=UIComponentType.TEXTBOX,
|
| 817 |
+
label="Development Components Analysis Prompt",
|
| 818 |
lines=20,
|
| 819 |
interactive=True
|
| 820 |
),
|
|
|
|
| 824 |
"recalculate_mandays": PromptConfig(
|
| 825 |
prompt=
|
| 826 |
"""
|
| 827 |
+
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).
|
| 828 |
+
|
| 829 |
Objective:
|
| 830 |
+
Recalculate the manday estimates for the identified priority 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.
|
| 831 |
+
|
| 832 |
+
Key Guidelines:
|
| 833 |
+
1. Retain Planning/Testing Components: All planning and testing components must be retained in the list but have their mandays set to 0. Do not remove them.
|
| 834 |
+
2. Focus on Development Components: Only adjust mandays for development components, ensuring the total **MUST BE WITHIN THE MVP TIMELINE SPECIFIED IN THE PRD**.
|
| 835 |
+
3. Convert Time Estimates: Convert all time estimates into raw mandays:
|
| 836 |
+
- 1 week = 7 mandays
|
| 837 |
+
- 1 month = 28-31 mandays
|
| 838 |
+
- If input is in days, use as is.
|
| 839 |
+
- If input is a range (e.g., 1-2 weeks), use the average (1.5 weeks = 7.5 mandays).
|
| 840 |
+
4. Exclude Non-Critical Components: If the total mandays exceed the timeline limit, REMOVE the least critical development components (e.g., advanced security, compliance, scalability, authentication, fallback mechanisms) until the total is within the timeline.
|
| 841 |
+
5. 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.
|
| 842 |
+
|
| 843 |
Output Format Requirements:
|
| 844 |
+
Provide a revised list of components with updated manday estimates, where:
|
| 845 |
+
- All planning/testing components are set to 0 mandays but remain in the list.
|
| 846 |
+
- Development components have adjusted mandays within the PRD timeline.
|
| 847 |
+
Include a brief explanation of any adjustments made to the estimates, particularly how they align with the timeline specified in the PRD.
|
| 848 |
""",
|
| 849 |
inputs=["identified_priority_components", "generated_prd"],
|
| 850 |
outputs=["revised_mandays_estimates"],
|
| 851 |
model=ModelType.O1_MINI,
|
| 852 |
+
description="Recalculate Mandays",
|
| 853 |
+
step="Step 2 : Planning & Testing Mandays",
|
| 854 |
ui={
|
| 855 |
"mandays_recalculation_prompt_editor": UIConfig(
|
| 856 |
component_type=UIComponentType.TEXTBOX,
|
| 857 |
+
label="Mandays Recalculation Prompt",
|
| 858 |
lines=20,
|
| 859 |
interactive=True
|
| 860 |
)
|
|
|
|
| 865 |
prompt=
|
| 866 |
"""
|
| 867 |
Using the revised mandays estimates from the previous step, format the output into two clearly separated CSV sections: one for Planning/Testing Priority Components and another for Development Priority Components.
|
| 868 |
+
|
| 869 |
Objective:
|
| 870 |
Structure the output to clearly delineate the two sections while maintaining the original column structure.
|
| 871 |
+
|
| 872 |
Output Format Requirements:
|
| 873 |
- First Section - Planning & Testing Priority Components:
|
| 874 |
+
component,mandays,description
|
| 875 |
+
"Requirements Analysis",0,"Critical user requirements and system specifications"
|
| 876 |
+
|
| 877 |
- Second Section - Development Priority Components:
|
| 878 |
+
component,subcomponent,mandays,description
|
| 879 |
+
"Backend","Core API Development",3,"Essential API endpoints for basic functionality"
|
| 880 |
+
|
| 881 |
Important:
|
| 882 |
- Each section must maintain its original column structure.
|
| 883 |
- Sections MUST be separated by the marker: "---SECTION BREAK---".
|
|
|
|
| 885 |
- No empty rows or missing values.
|
| 886 |
- Text values must be in double quotes.
|
| 887 |
- Numbers must not be in quotes.
|
| 888 |
+
|
| 889 |
Return only the CSV content with the section break, no additional text or explanations.
|
| 890 |
""",
|
| 891 |
inputs=["revised_mandays_estimates"],
|