feat: add NSFW script generation feature and Grok API configuration

This commit is contained in:
2026-03-13 12:58:28 +08:00
parent 424c3edf0b
commit 0d63d0e6d1
28 changed files with 850 additions and 36 deletions

View File

@@ -131,3 +131,23 @@ class LLMConfigResponse(BaseModel):
base_url: Optional[str] = None
model: Optional[str] = None
has_key: bool
class NsfwSynopsisGenerationRequest(BaseModel):
genre: str
subgenre: str = ""
protagonist_type: str = ""
tone: str = ""
conflict_scale: str = ""
num_characters: int = 5
num_chapters: int = 8
class NsfwScriptGenerationRequest(BaseModel):
title: str
genre: str
subgenre: str = ""
premise: str
style: str = ""
num_characters: int = 5
num_chapters: int = 8

View File

@@ -33,6 +33,7 @@ class User(UserBase):
is_active: bool
is_superuser: bool
can_use_local_model: bool
can_use_nsfw: bool = False
created_at: datetime
model_config = ConfigDict(from_attributes=True)
@@ -41,6 +42,7 @@ class UserCreateByAdmin(UserBase):
password: str = Field(..., min_length=8, max_length=128)
is_superuser: bool = False
can_use_local_model: bool = False
can_use_nsfw: bool = False
@field_validator('password')
@classmethod
@@ -60,6 +62,7 @@ class UserUpdate(BaseModel):
is_active: Optional[bool] = None
is_superuser: Optional[bool] = None
can_use_local_model: Optional[bool] = None
can_use_nsfw: Optional[bool] = None
@field_validator('username')
@classmethod