feat:接入mongodb

This commit is contained in:
2026-09-30 04:27:35 -07:00
parent f92909ccda
commit 16212d7138
11 changed files with 663 additions and 43 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
"""会话存储:创建时即占位,用于校验 ID 由后端签发;当前为进程内存实现"""
"""会话存储:创建时即占位,用于校验 ID 由后端签发;此处为协议和进程内存实现,MongoDB 实现见 conversation_mongo"""
from datetime import UTC, datetime, timedelta
from typing import Protocol
@@ -9,7 +9,7 @@ from app.schemas.conversation import Turn
class ConversationStore(Protocol):
"""后续接入 MongoDB 时实现同一组方法,业务代码不需要改动"""
"""内存和 MongoDB 实现同一组方法,业务代码不需要关心具体存储"""
async def create(self) -> str: ...