Commit ·
0d1d761
1
Parent(s): 775ea72
updated prompt to fit encoding
Browse files
app.py
CHANGED
|
@@ -20,10 +20,19 @@ def load_system_prompt():
|
|
| 20 |
"""Load the system prompt from prompt.md file."""
|
| 21 |
try:
|
| 22 |
with open("prompt.md", "r", encoding="utf-8") as f:
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
except FileNotFoundError:
|
| 25 |
print("WARNING: prompt.md not found. Using fallback prompt.")
|
| 26 |
return "You are an Adaptive Coach guiding a small team through the Design Thinking process."
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
|
| 29 |
# Initialize chain components (outside of handlers to avoid ContextVar issues)
|
|
|
|
| 20 |
"""Load the system prompt from prompt.md file."""
|
| 21 |
try:
|
| 22 |
with open("prompt.md", "r", encoding="utf-8") as f:
|
| 23 |
+
prompt_content = f.read()
|
| 24 |
+
# Verify the prompt loaded correctly (basic sanity check)
|
| 25 |
+
if len(prompt_content) < 100:
|
| 26 |
+
print("WARNING: prompt.md seems too short. Using fallback prompt.")
|
| 27 |
+
return "You are an Adaptive Coach guiding a small team through the Design Thinking process."
|
| 28 |
+
return prompt_content
|
| 29 |
except FileNotFoundError:
|
| 30 |
print("WARNING: prompt.md not found. Using fallback prompt.")
|
| 31 |
return "You are an Adaptive Coach guiding a small team through the Design Thinking process."
|
| 32 |
+
except UnicodeDecodeError as e:
|
| 33 |
+
print(
|
| 34 |
+
f"WARNING: Encoding error reading prompt.md: {e}. Using fallback prompt.")
|
| 35 |
+
return "You are an Adaptive Coach guiding a small team through the Design Thinking process."
|
| 36 |
|
| 37 |
|
| 38 |
# Initialize chain components (outside of handlers to avoid ContextVar issues)
|
prompt.md
CHANGED
|
@@ -256,14 +256,14 @@ Stay in dialogue when:
|
|
| 256 |
All artifacts use this wrapper:
|
| 257 |
|
| 258 |
```json
|
| 259 |
-
{
|
| 260 |
"artifact_type": "[phase_output | synthesis | session_capture]",
|
| 261 |
"phase": "[current DT phase]",
|
| 262 |
"status": "[draft | validated | final]",
|
| 263 |
-
"content": { },
|
| 264 |
"open_questions": [ ],
|
| 265 |
"next_steps": [ ]
|
| 266 |
-
}
|
| 267 |
```
|
| 268 |
|
| 269 |
### 7.3 Phase Output Templates
|
|
@@ -271,98 +271,98 @@ All artifacts use this wrapper:
|
|
| 271 |
**Phenomenon Map**
|
| 272 |
|
| 273 |
```json
|
| 274 |
-
{
|
| 275 |
"artifact_type": "phase_output",
|
| 276 |
"phase": "phenomenon_mapping",
|
| 277 |
-
"content": {
|
| 278 |
"domain": "",
|
| 279 |
"key_actors": [ ],
|
| 280 |
"forces_and_trends": [ ],
|
| 281 |
"relationships": [ ],
|
| 282 |
"boundaries": "",
|
| 283 |
"unknowns": [ ]
|
| 284 |
-
}
|
| 285 |
-
}
|
| 286 |
```
|
| 287 |
|
| 288 |
**Empathy Synthesis**
|
| 289 |
|
| 290 |
```json
|
| 291 |
-
{
|
| 292 |
"artifact_type": "phase_output",
|
| 293 |
"phase": "empathy_discovery",
|
| 294 |
-
"content": {
|
| 295 |
"user_segments": [ ],
|
| 296 |
"key_observations": [ ],
|
| 297 |
"quotes_and_evidence": [ ],
|
| 298 |
"pain_points": [ ],
|
| 299 |
"unmet_needs": [ ],
|
| 300 |
"surprises": [ ]
|
| 301 |
-
}
|
| 302 |
-
}
|
| 303 |
```
|
| 304 |
|
| 305 |
**Problem Statement**
|
| 306 |
|
| 307 |
```json
|
| 308 |
-
{
|
| 309 |
"artifact_type": "phase_output",
|
| 310 |
"phase": "problem_definition",
|
| 311 |
-
"content": {
|
| 312 |
"user": "",
|
| 313 |
"need": "",
|
| 314 |
"insight": "",
|
| 315 |
"problem_statement": "",
|
| 316 |
"scope_boundaries": "",
|
| 317 |
"success_criteria": [ ]
|
| 318 |
-
}
|
| 319 |
-
}
|
| 320 |
```
|
| 321 |
|
| 322 |
**Ideation Output**
|
| 323 |
|
| 324 |
```json
|
| 325 |
-
{
|
| 326 |
"artifact_type": "phase_output",
|
| 327 |
"phase": "ideation",
|
| 328 |
-
"content": {
|
| 329 |
"concepts": [
|
| 330 |
-
{
|
| 331 |
"name": "",
|
| 332 |
"description": "",
|
| 333 |
"novelty": "low | medium | high",
|
| 334 |
"feasibility": "low | medium | high"
|
| 335 |
-
}
|
| 336 |
],
|
| 337 |
"selection_criteria": [ ],
|
| 338 |
"selected_for_prototyping": [ ]
|
| 339 |
-
}
|
| 340 |
-
}
|
| 341 |
```
|
| 342 |
|
| 343 |
**Prototype Spec**
|
| 344 |
|
| 345 |
```json
|
| 346 |
-
{
|
| 347 |
"artifact_type": "phase_output",
|
| 348 |
"phase": "prototyping",
|
| 349 |
-
"content": {
|
| 350 |
"concept": "",
|
| 351 |
"prototype_type": "[paper | digital | physical | service | wizard-of-oz]",
|
| 352 |
"fidelity": "low | medium | high",
|
| 353 |
"core_assumptions_to_test": [ ],
|
| 354 |
"build_description": ""
|
| 355 |
-
}
|
| 356 |
-
}
|
| 357 |
```
|
| 358 |
|
| 359 |
**Test Results**
|
| 360 |
|
| 361 |
```json
|
| 362 |
-
{
|
| 363 |
"artifact_type": "phase_output",
|
| 364 |
"phase": "testing",
|
| 365 |
-
"content": {
|
| 366 |
"test_protocol": "",
|
| 367 |
"participants": "",
|
| 368 |
"key_findings": [ ],
|
|
@@ -371,8 +371,8 @@ All artifacts use this wrapper:
|
|
| 371 |
"surprises": [ ],
|
| 372 |
"decision": "[iterate | pivot | advance]",
|
| 373 |
"next_iteration_focus": ""
|
| 374 |
-
}
|
| 375 |
-
}
|
| 376 |
```
|
| 377 |
|
| 378 |
### 7.4 Session Capture
|
|
@@ -380,18 +380,18 @@ All artifacts use this wrapper:
|
|
| 380 |
**Session Capture**
|
| 381 |
|
| 382 |
```json
|
| 383 |
-
{
|
| 384 |
"artifact_type": "session_capture",
|
| 385 |
"status": "complete",
|
| 386 |
-
"content": {
|
| 387 |
"executive_summary": "",
|
| 388 |
"phases_completed": [ ],
|
| 389 |
"key_outputs": [ ],
|
| 390 |
"decisions_made": [ ],
|
| 391 |
"open_questions": [ ],
|
| 392 |
"recommended_next_session_focus": ""
|
| 393 |
-
}
|
| 394 |
-
}
|
| 395 |
```
|
| 396 |
|
| 397 |
-----
|
|
|
|
| 256 |
All artifacts use this wrapper:
|
| 257 |
|
| 258 |
```json
|
| 259 |
+
{{
|
| 260 |
"artifact_type": "[phase_output | synthesis | session_capture]",
|
| 261 |
"phase": "[current DT phase]",
|
| 262 |
"status": "[draft | validated | final]",
|
| 263 |
+
"content": {{ }},
|
| 264 |
"open_questions": [ ],
|
| 265 |
"next_steps": [ ]
|
| 266 |
+
}}
|
| 267 |
```
|
| 268 |
|
| 269 |
### 7.3 Phase Output Templates
|
|
|
|
| 271 |
**Phenomenon Map**
|
| 272 |
|
| 273 |
```json
|
| 274 |
+
{{
|
| 275 |
"artifact_type": "phase_output",
|
| 276 |
"phase": "phenomenon_mapping",
|
| 277 |
+
"content": {{
|
| 278 |
"domain": "",
|
| 279 |
"key_actors": [ ],
|
| 280 |
"forces_and_trends": [ ],
|
| 281 |
"relationships": [ ],
|
| 282 |
"boundaries": "",
|
| 283 |
"unknowns": [ ]
|
| 284 |
+
}}
|
| 285 |
+
}}
|
| 286 |
```
|
| 287 |
|
| 288 |
**Empathy Synthesis**
|
| 289 |
|
| 290 |
```json
|
| 291 |
+
{{
|
| 292 |
"artifact_type": "phase_output",
|
| 293 |
"phase": "empathy_discovery",
|
| 294 |
+
"content": {{
|
| 295 |
"user_segments": [ ],
|
| 296 |
"key_observations": [ ],
|
| 297 |
"quotes_and_evidence": [ ],
|
| 298 |
"pain_points": [ ],
|
| 299 |
"unmet_needs": [ ],
|
| 300 |
"surprises": [ ]
|
| 301 |
+
}}
|
| 302 |
+
}}
|
| 303 |
```
|
| 304 |
|
| 305 |
**Problem Statement**
|
| 306 |
|
| 307 |
```json
|
| 308 |
+
{{
|
| 309 |
"artifact_type": "phase_output",
|
| 310 |
"phase": "problem_definition",
|
| 311 |
+
"content": {{
|
| 312 |
"user": "",
|
| 313 |
"need": "",
|
| 314 |
"insight": "",
|
| 315 |
"problem_statement": "",
|
| 316 |
"scope_boundaries": "",
|
| 317 |
"success_criteria": [ ]
|
| 318 |
+
}}
|
| 319 |
+
}}
|
| 320 |
```
|
| 321 |
|
| 322 |
**Ideation Output**
|
| 323 |
|
| 324 |
```json
|
| 325 |
+
{{
|
| 326 |
"artifact_type": "phase_output",
|
| 327 |
"phase": "ideation",
|
| 328 |
+
"content": {{
|
| 329 |
"concepts": [
|
| 330 |
+
{{
|
| 331 |
"name": "",
|
| 332 |
"description": "",
|
| 333 |
"novelty": "low | medium | high",
|
| 334 |
"feasibility": "low | medium | high"
|
| 335 |
+
}}
|
| 336 |
],
|
| 337 |
"selection_criteria": [ ],
|
| 338 |
"selected_for_prototyping": [ ]
|
| 339 |
+
}}
|
| 340 |
+
}}
|
| 341 |
```
|
| 342 |
|
| 343 |
**Prototype Spec**
|
| 344 |
|
| 345 |
```json
|
| 346 |
+
{{
|
| 347 |
"artifact_type": "phase_output",
|
| 348 |
"phase": "prototyping",
|
| 349 |
+
"content": {{
|
| 350 |
"concept": "",
|
| 351 |
"prototype_type": "[paper | digital | physical | service | wizard-of-oz]",
|
| 352 |
"fidelity": "low | medium | high",
|
| 353 |
"core_assumptions_to_test": [ ],
|
| 354 |
"build_description": ""
|
| 355 |
+
}}
|
| 356 |
+
}}
|
| 357 |
```
|
| 358 |
|
| 359 |
**Test Results**
|
| 360 |
|
| 361 |
```json
|
| 362 |
+
{{
|
| 363 |
"artifact_type": "phase_output",
|
| 364 |
"phase": "testing",
|
| 365 |
+
"content": {{
|
| 366 |
"test_protocol": "",
|
| 367 |
"participants": "",
|
| 368 |
"key_findings": [ ],
|
|
|
|
| 371 |
"surprises": [ ],
|
| 372 |
"decision": "[iterate | pivot | advance]",
|
| 373 |
"next_iteration_focus": ""
|
| 374 |
+
}}
|
| 375 |
+
}}
|
| 376 |
```
|
| 377 |
|
| 378 |
### 7.4 Session Capture
|
|
|
|
| 380 |
**Session Capture**
|
| 381 |
|
| 382 |
```json
|
| 383 |
+
{{
|
| 384 |
"artifact_type": "session_capture",
|
| 385 |
"status": "complete",
|
| 386 |
+
"content": {{
|
| 387 |
"executive_summary": "",
|
| 388 |
"phases_completed": [ ],
|
| 389 |
"key_outputs": [ ],
|
| 390 |
"decisions_made": [ ],
|
| 391 |
"open_questions": [ ],
|
| 392 |
"recommended_next_session_focus": ""
|
| 393 |
+
}}
|
| 394 |
+
}}
|
| 395 |
```
|
| 396 |
|
| 397 |
-----
|