refactor(chat): decompose core.js into scroll.js, messages.js, input.js, and core.js
This commit is contained in:
@@ -44,9 +44,6 @@ class ChatMessageRequest(BaseModel):
|
||||
session_id: Optional[str] = "session_main"
|
||||
|
||||
|
||||
class UpdateSessionRequest(BaseModel):
|
||||
title: str
|
||||
|
||||
class CreateSessionRequest(BaseModel):
|
||||
title: Optional[str] = None
|
||||
session_id: Optional[str] = None
|
||||
@@ -82,17 +79,6 @@ def create_chat_session_endpoint(payload: CreateSessionRequest, current_user=Dep
|
||||
return {"status": "success", "session": session}
|
||||
|
||||
|
||||
|
||||
@router.patch("/sessions/{session_id}")
|
||||
def update_chat_session_endpoint(session_id: str, payload: UpdateSessionRequest, current_user=Depends(get_current_user)):
|
||||
"""Ручное переименование названия диалога оператором."""
|
||||
new_title = payload.title.strip()
|
||||
if not new_title:
|
||||
raise HTTPException(status_code=400, detail="Название не может быть пустым")
|
||||
db_update_session_title(session_id=session_id, new_title=new_title)
|
||||
return {"status": "success", "session_id": session_id, "title": new_title}
|
||||
|
||||
|
||||
@router.delete("/sessions/{session_id}")
|
||||
def delete_chat_session_endpoint(session_id: str, current_user=Depends(get_current_user)):
|
||||
"""Каскадное удаление темы и всех её сообщений."""
|
||||
|
||||
Reference in New Issue
Block a user