feat: refine topic insights and learner experience

This commit is contained in:
2026-08-17 12:42:16 +08:00
parent 77399df060
commit 833763c461
27 changed files with 848 additions and 182 deletions

View File

@@ -20,6 +20,7 @@ from app.schemas.chat import (
ChatCompletionRequest,
ChatMessageRead,
ChatSessionRead,
CreateSessionRequest,
CreateSessionResponse,
StopChatRequest,
UpdateSessionTitleRequest,
@@ -43,8 +44,17 @@ logger = logging.getLogger(__name__)
@router.post("/session")
def create_session(db: Session = Depends(get_db), current: UserAuthContext = Depends(get_current_user_context)) -> dict:
session = ChatService.create_session(db, current.user, current.chat_scope)
def create_session(
payload: CreateSessionRequest | None = None,
db: Session = Depends(get_db),
current: UserAuthContext = Depends(get_current_user_context),
) -> dict:
session = ChatService.create_session(
db,
current.user,
current.chat_scope,
current_session_id=payload.currentSessionId if payload else None,
)
return api_success(CreateSessionResponse(sessionId=session.id).model_dump())