-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo_script.py
More file actions
46 lines (39 loc) · 1.78 KB
/
Copy pathdemo_script.py
File metadata and controls
46 lines (39 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# demo_script.py
from onboarding_coordinator_agent import OnboardingCoordinatorAgent
import time
# Simulated patient responses (replace or randomize as needed)
demo_responses = [
"John Doe", # name
"29", # age
"555-123-4567", # phone
"Jane Doe, 555-987-6543", # emergency contact
"4", # mood
"poor", # sleep
"I’ve been feeling extremely overwhelmed and hopeless lately", # concern
"no" # triggers crisis
]
def run_demo():
print("\n🎬 Starting Demo: CompassionateConnect AI")
coordinator = OnboardingCoordinatorAgent(project_id="compassionate-connect-ai")
current_question = coordinator.intake_agent.start_intake()
for response in demo_responses:
time.sleep(1) # Simulate pause
print(f"\n🧑 Patient: {response}")
if current_question.get('type') == 'clarification':
current_question = current_question['question']
result = coordinator.intake_agent.process_response(response, current_question)
if result.get('type') == 'crisis':
print("\n🚨 Crisis Detected. Redirecting to CrisisResponseAgent...")
coordinator.crisis_agent.handle_crisis(response)
return
elif result.get('type') == 'completed':
print("\n✅ Intake Complete. Saving data + generating summary...")
data = result['data']
coordinator.storage_agent.save_data(data)
summary = coordinator.summary_agent.generate_summary(data)
coordinator.storage_agent.save_summary_with_data(summary, data)
print("\n🩺 Thank you. The office will reach out to you.")
return
current_question = result
if __name__ == "__main__":
run_demo()