SafeStreamDemo / schemas.py
Shubhi324's picture
Upload 2 files
32ca500 verified
raw
history blame contribute delete
675 Bytes
from pydantic import BaseModel
from typing import Optional, List
# Video Schemas
class VideoBase(BaseModel):
title: str
url: str
description: Optional[str] = None
class VideoCreate(VideoBase):
pass
class Video(VideoBase):
id: int
class Config:
orm_mode = True
# Comment Schemas
class CommentBase(BaseModel):
video_id: int
user: str
text: str
timestamp: Optional[str] = None
class CommentCreate(CommentBase):
pass
class Comment(CommentBase):
id: int
is_toxic: bool
toxicity_score: float
flagged_reason: Optional[str] = None
class Config:
orm_mode = True