chore: 服务端品牌与行业残留更名清零(HESUPIPE/DB名/redis字段)
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
"""REST shell for the HESU app (non-streaming, JSON-in/JSON-out).
|
||||
"""REST shell for the HESUPIPE app (non-streaming, JSON-in/JSON-out).
|
||||
|
||||
These routes wrap `ConversationManager`, shared with the existing `/ws/chat`
|
||||
widget path. The app uses HTTP because it lacks a WebSocket client and is fine
|
||||
|
||||
+1
-5
@@ -14,11 +14,7 @@ class Settings(BaseSettings):
|
||||
ZHIPU_BASE_URL: str = ""
|
||||
AI_MODEL: str = "glm-4-flash"
|
||||
|
||||
DATABASE_URL: str = "sqlite+aiosqlite:///./data/cc_ai_kefu.db"
|
||||
|
||||
REDIS_URL: str = "redis://localhost:6379/0"
|
||||
REDIS_PASSWORD: str = ""
|
||||
SESSION_TTL: int = 86400 # 24 hours
|
||||
DATABASE_URL: str = "sqlite+aiosqlite:///./data/hesupipe_ai_kefu.db"
|
||||
|
||||
SMTP_HOST: str = ""
|
||||
SMTP_PORT: int = 465
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ async def lifespan(app: FastAPI):
|
||||
yield
|
||||
|
||||
|
||||
app = FastAPI(title="AI汽车客服", lifespan=lifespan)
|
||||
app = FastAPI(title="HESUPIPE AI 客服", lifespan=lifespan)
|
||||
|
||||
from app.api.routes.chat import router as chat_router
|
||||
from app.api.routes.admin import router as admin_router
|
||||
|
||||
@@ -71,7 +71,7 @@ async def send_lead_email(
|
||||
if contact_parts:
|
||||
subject += " | " + ", ".join(contact_parts)
|
||||
msg["Subject"] = subject
|
||||
msg["From"] = f"【XYH】 <{settings.SMTP_USER}>"
|
||||
msg["From"] = f"【HESUPIPE】 <{settings.SMTP_USER}>"
|
||||
msg["To"] = settings.NOTIFY_EMAIL
|
||||
|
||||
info_rows = "".join(
|
||||
@@ -108,7 +108,7 @@ async def send_returning_lead_email(contact_info: dict) -> bool:
|
||||
]
|
||||
msg = MIMEMultipart("alternative")
|
||||
msg["Subject"] = f"[线索回访] {' | '.join(contact_parts) or '已知客户'}再次来访"
|
||||
msg["From"] = f"【XYH】 <{settings.SMTP_USER}>"
|
||||
msg["From"] = f"【HESUPIPE】 <{settings.SMTP_USER}>"
|
||||
msg["To"] = settings.NOTIFY_EMAIL
|
||||
msg.attach(MIMEText(
|
||||
f"<html><body><p>该联系方式 24h 内已发过完整询盘,客户又开启了新对话,"
|
||||
@@ -120,7 +120,7 @@ async def send_correction_email(contact_info: dict, count: int = 1) -> bool:
|
||||
"""D4: 联系方式变化(改号/新增/无提示换值)后的轻量更正邮件,每会话上限3封。"""
|
||||
msg = MIMEMultipart("alternative")
|
||||
msg["Subject"] = f"[询盘·更正{count}] 客户联系方式已更新(以本封为准)"
|
||||
msg["From"] = f"【XYH】 <{settings.SMTP_USER}>"
|
||||
msg["From"] = f"【HESUPIPE】 <{settings.SMTP_USER}>"
|
||||
msg["To"] = settings.NOTIFY_EMAIL
|
||||
msg.attach(MIMEText(
|
||||
f"<html><body><p>这是本会话第 {count} 次更正(上限 3 次),请以本封为准:</p>"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Minimal in-memory rate limiter (per (ip, device_id), rolling 1h window).
|
||||
|
||||
Mirrors hesu's rate_limit.py shape. Only the chat message route uses this;
|
||||
Kept aligned with the reference implementation's rate_limit.py shape. Only the chat message route uses this;
|
||||
session/history endpoints are cheap and not throttled. State is process-local
|
||||
and resets on restart, which is acceptable for a single-worker ai-kefu deploy.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user