mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 20:12:55 +01:00
Updated chat history and items id with uuid
This commit is contained in:
parent
4bc9dd7870
commit
ee0e1cd839
13 changed files with 85 additions and 29 deletions
|
|
@ -2,14 +2,14 @@ from typing import Optional, List, Union, Dict, Any
|
|||
from fastapi import HTTPException, status
|
||||
from sqlalchemy.orm import Session
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
|
||||
import uuid
|
||||
from private_gpt.users.crud.base import CRUDBase
|
||||
from private_gpt.users.models.chat import ChatHistory, ChatItem
|
||||
from private_gpt.users.schemas.chat import ChatHistoryCreate, ChatHistoryCreate, ChatItemCreate, ChatItemUpdate
|
||||
|
||||
|
||||
class CRUDChat(CRUDBase[ChatHistory, ChatHistoryCreate, ChatHistoryCreate]):
|
||||
def get_by_id(self, db: Session, *, id: int) -> Optional[ChatHistory]:
|
||||
def get_by_id(self, db: Session, *, id: uuid.UUID) -> Optional[ChatHistory]:
|
||||
return db.query(self.model).filter(ChatHistory.conversation_id == id).first()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue