Skip to content

chinensdkcsdck/Medical-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedicalAgent Pro MVP

MedicalAgent Pro is a FastAPI-based medical triage MVP. The current version supports a rule-based triage workflow, Top3 department suggestions, safety prompts, and Redis-backed multi-turn session memory.

Environment

This project is configured locally for Python 3.12:

C:\Users\chnnb\AppData\Local\Programs\Python\Python312\python.exe -m pip install -r requirements.txt

Optional Redis settings:

$env:REDIS_URL="redis://localhost:6379/0"
$env:SESSION_TTL_SECONDS="86400"

If Redis is not running, the app falls back to an in-memory session store for local development.

Run

uvicorn app.main:app --reload

API

POST /api/chat

Single-turn example:

{
  "session_id": "session_001",
  "message": "我头痛三天了,还恶心,应该挂什么科?"
}

Multi-turn example:

{
  "session_id": "session_002",
  "message": "我头痛"
}

Then continue with the same session_id:

{
  "session_id": "session_002",
  "message": "三天了,还有点恶心"
}

Response fields include:

{
  "session_id": "session_002",
  "answer": "...",
  "intent": "guide_patient",
  "slots": {},
  "departments": [],
  "trace_id": "trace_...",
  "status": "collecting",
  "missing_slots": ["duration"]
}

Session data is stored under Redis keys like:

medicalagent:session:{session_id}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages