Please enable JavaScript.
Coggle requires JavaScript to display documents.
Melatec Booking, Luồng Melatec (A Cường) - Coggle Diagram
Melatec Booking
book_apointment.py
SubGraph
detect_intent
manage_main
manage_step_detecting
Phân loại step tiếp theo
- prompt input: memory_cache + current_chat = "\n".join(last_history) + "\nuser: " + memory_cache.get("current_user_input", "")
- output: next_node_name
- Logic: Không có flow_choosing, cho model tự quyết định sẽ gọi đến thằng nào trong 4 thằng show/view/update/cancel
view_booking_info
Xem lịch hẹn
- collection fields:
- view_all_infor: bool
- view_fields_choice: list[str]
- selected_appointment_id: str
-
appointment_update_info_collecting
Thu thập thông tin cần cập nhật và xin xác nhận.
- collected_fields:
- update_fields: dict[str, Any]
- selected_appointment_id: str
-
-
appointment_cancel_info_collecting
Thu thập lí do xoá và xin xác nhận.
- collected_fields:
- selected_appointment_id: str
- cancel_reason: str
-
show_appointments_list
Hỏi số điện thoại và hiển thị danh sách các lịch hẹn người dùng
- output fields:
- appointments_list
- collection fields:
- collected_phone
- time_filter
grounding_node
Cập nhật lại memory_cache và history_chat_cache, giữ nguyên và trả về last_response từ node trước
- prompt: memory_cache + history_chat_cache(3) + last_response -> Rewrite lại memory_cache.get("memory")
- output: last_response
booking_main
booking_step_detecting
Phân loại step tiếp theo
- input: memory_cache
- output: next_node_name
- prompt: memory_cache -> next_node_name. Đầu tiên là family_lookup -> basic_info_collecting. Từ đây phân 2 luồng: Nếu user muốn đặt lịch nhanh (ask_more_choice == no_and_quick) thì bước tiếp theo là quick_booking rồi kết thúc; Nếu user muốn cung cấp thêm thông tin để đặt lịch thường (ask_more_choice == yes_more) thì bước tiếp theo là normal_{exam_method}_booking_info_collecting và normal_booking và kết thúc.
basic_info_collecting
Thu thập 4 trường cơ bản và xác minh xác nhận của người dùng
- Các trường
- collected_phone
- collected_name
- exam_method
- ask_more_choice
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache + fields_cache để nhìn ra các trường còn thiếu, đặt câu hỏi thu thập thêm nếu còn thiếu, nếu không thiếu thì hãy xác nhận lại với người dùng.
- tools: ask_for_missing_info; confirm_info
-
family_lookup
Nhận diện thành viên trong gia đình. Đưa vào cache nếu có thông tin sẵn. Nếu unknown thì tạo mới.
- input: user_history (5) + family_list_member
- output: last_response
- prompt: detect dựa trên user_history (5) + family_list_member
-
grounding_node
Cập nhật lại memory_cache và history_chat_cache, giữ nguyên và trả về last_response từ node trước
- prompt: memory_cache + history_chat_cache(3) + last_response -> Rewrite lại memory_cache.get("memory")
- output: last_response
-
quick_booking
Đặt lịch nhanh
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache để chọn ra 1 trong 2 tools ...
- tools: booking; notify
-
normal_hospital_booking_info_collecting
Thu thập thêm thông tin chi tiết để phục vụ chức năng đặt lịch thường khám ở viện
- Các trường
- dob
- gender
- facilities_list
- selected_center
- selected_datetime: Ràng buộc 7h30 - 17h00
- reason_note
- address
- specialist
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache + fields_cache để nhìn ra các trường còn thiếu, đặt câu hỏi thu thập thêm nếu còn thiếu, nếu không thiếu thì hãy xác nhận lại với người dùng.
- tools: ask_for_missing_info; confirm_info; get_facilities_list
-
normal_booking
Đặt lịch thường
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache để chọn ra 1 trong 2 tools ...
- tools: booking; notify
-
normal_home_booking_info_collecting
Thu thập thêm thông tin chi tiết để phục vụ chức năng đặt lịch thường khám tại nhà
- Các trường
- dob
- gender
- address: Ràng buộc chỉ tại Hà Nội
- reason_note
- selected_datetime: Ràng buộc 7h30 - 17h00
- in_service_area: bool
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache + fields_cache để nhìn ra các trường còn thiếu, đặt câu hỏi thu thập thêm nếu còn thiếu, nếu không thiếu thì hãy xác nhận lại với người dùng.
- tools: ask_for_missing_info; confirm_info
-
-
normal_test_booking_info_collecting
Thu thập thêm thông tin chi tiết để phục vụ chức năng đặt lịch thường lấy mẫu xét nghiệm tại nhà
- Các trường
- dob
- gender
- address: Ràng buộc chỉ tại Hà Nội
- reason_note
- selected_datetime: Ràng buộc 6:00 – 22:00
- tests_requested
- in_service_area: bool
- input: memory_cache + fields_cache
- output: last_response
- prompt: Nhìn vào memory_cache + fields_cache để nhìn ra các trường còn thiếu, đặt câu hỏi thu thập thêm nếu còn thiếu, nếu không thiếu thì hãy xác nhận lại với người dùng.
- tools: ask_for_missing_info; confirm_info
-
-
-
-
-
Cache
- Thông tin cơ bản như trong state hiện tại
- history_chat
- end_chat_flag
memory_cache
Thông tin lịch sử chat được tóm tắt + thời gian hiện tại + Câu nói hiện tại của người dùng
-
-
-