feat(visitor): Implement visitor chat functionality and enhance customer service interactions

- Added a new visitor chat API endpoint (`/api/chat/visitor`) to allow unauthenticated users to engage in conversations without requiring customer data.
- Introduced a visitor context dependency to manage visitor interactions seamlessly.
- Enhanced the chat API to support explicit session termination and improved response handling for customer service interactions.
- Updated the database configuration to include Redis client support for caching visitor data.
- Added a new customer note repository to persist user notes independently of the L1 profile slots.

This update significantly improves the customer service experience by enabling visitor interactions and ensuring efficient data handling for both registered and unregistered users.
This commit is contained in:
2026-09-09 18:32:00 +08:00
parent ad930c26b1
commit b841f68295
98 changed files with 10682 additions and 630 deletions
+20
View File
@@ -95,9 +95,29 @@ HOST_ONLY_SKIP_PREFIXES = (
"app/utils/exceptions.py",
)
# 客服 Agent S2 接缝(docs/项目框架设计/客服Agent-合并说明.md)— 允许 import 宿主 schemas
CUSTOMER_AGENT_SEAM_SKIP = (
"app/api/auth_adapter.py",
"app/api/visitor.py",
"app/repository/note_repository.py",
"app/repository/profile_repository.py",
"app/service/customer_service.py",
"app/service/customer_prompts.py",
"app/service/note_service.py",
"app/service/profile_service.py",
"app/service/visitor_prompts.py",
"app/service/visitor_service.py",
"app/tool/core_ro_tool.py",
"app/utils/compliance_guard.py",
"app/utils/data_masker.py",
"app/config/profile_slots.py",
)
def _is_host_only_file(path: Path) -> bool:
rel = path.relative_to(APP_DIR.parent).as_posix()
if rel in CUSTOMER_AGENT_SEAM_SKIP:
return True
return rel.startswith(HOST_ONLY_SKIP_PREFIXES)