added image ai-moderation
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from pydantic import BaseModel
|
||||
from pydantic import Field
|
||||
|
||||
|
||||
class TextRequest(BaseModel):
|
||||
text: str = Field(..., description="The text to be moderated")
|
||||
|
||||
text: str = Field(
|
||||
min_length=1,
|
||||
max_length=5000
|
||||
)
|
||||
6
ai-moderation/app/models/response/error_response.py
Normal file
6
ai-moderation/app/models/response/error_response.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ErrorResponse(BaseModel):
|
||||
code: str
|
||||
message: str
|
||||
@@ -0,0 +1,16 @@
|
||||
from typing import List
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class ImageModerationResponse(BaseModel):
|
||||
|
||||
approved: bool
|
||||
|
||||
score: float
|
||||
|
||||
reason: str
|
||||
|
||||
label: str
|
||||
|
||||
detected_labels: List[str]
|
||||
Reference in New Issue
Block a user