feat: implement voice-based patient onboarding pipeline with AI orchestration, multi-language STT/TTS support, and clinical state extraction.

This commit is contained in:
2026-08-29 15:09:31 +05:30
parent 5e500dcfbc
commit dc2799a95b
14 changed files with 733 additions and 191 deletions
@@ -0,0 +1,30 @@
import httpx
client = httpx.Client(timeout=30.0)
test_cases = [
("Cardiology Test", "எனக்கு நெஞ்சு வலி மற்றும் மூச்சு திணறல் இருக்கு"),
("Dermatology Test", "தோல் அரிப்பு மற்றும் படை உள்ளது"),
("Orthopedics Test", "மூட்டு வலி நடக்க முடியல"),
("Neurology Test", "headache and dizziness for 3 days"),
("Gastroenterology Test", "வயிற்று வலி மற்றும் வாந்தி"),
("Pulmonology Test", "இருமல் மற்றும் சளி அதிகமாக உள்ளது"),
("ENT Test", "காது வலி மற்றும் தொண்டை வலி")
]
print("=== AUTOMATIC SPECIALTY TRIAGE ENGINE TEST ===")
for label, symptom in test_cases:
start_res = client.post("http://127.0.0.1:8000/v1/voice-onboarding/start", json={
"patient": {"id": "PAT-AUTO", "first_name": "Arun", "last_name": "Kumar"},
"category": {"type": "general", "code": "general_medicine", "name": "General Medicine"},
"language": "ta-IN"
})
sid = start_res.json()["session_id"]
turn_res = client.post(f"http://127.0.0.1:8000/v1/voice-onboarding/{sid}/turn", data={"text_fallback": symptom})
spec = turn_res.json().get("suggested_specialty", {})
print(f"Label: {label}")
print(f" Patient Symptom: '{symptom}'")
print(f" --> Auto-Assigned Specialty: {spec.get('name')} (Code: {spec.get('code')})")
print(f" --> Reasoning: {spec.get('reason')}\n")