@@ -120,13 +120,24 @@ class NewPassword(SQLModel):
120120 token : str
121121 new_password : str = Field (min_length = 8 , max_length = 40 )
122122
123+ # ------------------------Character Model----------------------------
123124
124125# Shared properties
125126class CharacterBase (SQLModel ):
126127 name : str = Field (index = True , max_length = 100 )
127128 description : str | None = Field (default = None , max_length = 1000 )
128129 image_url : str | None = Field (default = None , max_length = 255 )
129130 greeting_message : str | None = Field (default = None , max_length = 1000 )
131+ # More field
132+ scenario : str | None = Field (default = None , max_length = 2000 )
133+ category : str | None = Field (default = None , max_length = 255 )
134+ greeting : str | None = Field (default = None , max_length = 1000 )
135+ voice_id : str | None = Field (default = None , max_length = 255 )
136+ language : str | None = Field (default = None , max_length = 50 )
137+ tags : list [str ] | None = Field (default = None )
138+ popularity_score : float | None = Field (default = None )
139+ is_featured : bool = Field (default = False )
140+ created_at : datetime = Field (default_factory = datetime .utcnow )
130141
131142
132143class CharacterStatus (str , Enum ):
@@ -146,25 +157,43 @@ class CharacterUpdate(CharacterBase):
146157 description : str | None = Field (default = None , max_length = 1000 )
147158 image_url : str | None = Field (default = None , max_length = 255 )
148159 greeting_message : str | None = Field (default = None , max_length = 1000 )
160+ # More fields
161+ scenario : str | None = Field (default = None , max_length = 2000 )
162+ greeting : str | None = Field (default = None , max_length = 1000 )
163+ category : str | None = Field (default = None , max_length = 255 )
164+ voice_id : str | None = Field (default = None , max_length = 255 )
165+ language : str | None = Field (default = None , max_length = 50 )
166+ tags : list [str ] | None = Field (default = None )
167+ popularity_score : float | None = Field (default = 0.0 )
168+ is_featured : bool = Field (default = False )
169+ created_at : datetime | None = None
170+
149171 status : CharacterStatus | None = None
150172
151173
152174# Database model
153175class Character (CharacterBase , table = True ):
154176 id : uuid .UUID = Field (default_factory = uuid .uuid4 , primary_key = True )
177+
155178 status : CharacterStatus = Field (default = CharacterStatus .PENDING )
179+ like_count : int = Field (default = 0 )
180+ total_messages : int = Field (default = 0 )
181+
156182 creator_id : uuid .UUID = Field (foreign_key = "user.id" , nullable = False )
157183
158184 creator : User = Relationship (back_populates = "created_characters" )
159185 conversations : list ["Conversation" ] = Relationship (back_populates = "character" )
160186
161-
162187# Properties to return via API
163188class CharacterPublic (CharacterBase ):
164189 id : uuid .UUID
165190 status : CharacterStatus
166191 creator_id : uuid .UUID
167192
193+ like_count : int
194+ total_messages : int
195+ created_at : datetime
196+
168197
169198class CharactersPublic (SQLModel ):
170199 data : list [CharacterPublic ]
0 commit comments