Spaces:
Runtime error
Runtime error
| from appointment_service import get_appointments_by_phone | |
| from database_actions import get_doctors_by_specialization | |
| from rag_engine import search_documents | |
| from database_actions import get_followups_by_phone | |
| # ------------------------------- | |
| # Appointment Database Tool | |
| # ------------------------------- | |
| def appointment_tool(phone): | |
| phone = str(phone).strip() | |
| appointments = get_appointments_by_phone(phone) | |
| print("APPOINTMENT SERVICE RESULT:") | |
| print(appointments) | |
| if not appointments: | |
| return None | |
| return appointments | |
| # ------------------------------- | |
| # RAG Tool | |
| # ------------------------------- | |
| def hospital_policy_tool(question): | |
| documents = search_documents(question) | |
| if not documents: | |
| return None | |
| return documents | |
| # ------------------------------- | |
| # Doctor Search Tool | |
| # ------------------------------- | |
| def doctor_search_tool(department): | |
| doctors = get_doctors_by_specialization( | |
| department | |
| ) | |
| print("DOCTOR SEARCH RESULT:") | |
| print(doctors) | |
| if not doctors: | |
| return None | |
| return doctors | |
| # ------------------------------- | |
| # Followup Tool | |
| # ------------------------------- | |
| def followup_tool(phone): | |
| followups = get_followups_by_phone(phone) | |
| print("FOLLOWUP RESULT:") | |
| print(followups) | |
| if not followups: | |
| return None | |
| return followups |