@@ -120,13 +120,26 @@ 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+
136+ voice_id : str | None = Field (default = None , max_length = 255 )
137+ language : str | None = Field (default = None , max_length = 50 )
138+ tags : list [str ] | None = Field (default = None )
139+ popularity_score : float | None = Field (default = None )
140+ is_featured : bool = Field (default = False )
141+
142+ created_at : datetime = Field (default_factory = datetime .utcnow )
130143
131144
132145class CharacterStatus (str , Enum ):
@@ -146,25 +159,42 @@ class CharacterUpdate(CharacterBase):
146159 description : str | None = Field (default = None , max_length = 1000 )
147160 image_url : str | None = Field (default = None , max_length = 255 )
148161 greeting_message : str | None = Field (default = None , max_length = 1000 )
162+ # More fields
163+ scenario : str | None = Field (default = None , max_length = 2000 )
164+ greeting : str | None = Field (default = None , max_length = 1000 )
165+ category : str | None = Field (default = None , max_length = 255 )
166+ voice_id : str | None = Field (default = None , max_length = 255 )
167+ language : str | None = Field (default = None , max_length = 50 )
168+ tags : list [str ] | None = Field (default = None )
169+
170+ is_featured : bool = Field (default = False )
171+ created_at : datetime | None = None
149172 status : CharacterStatus | None = None
150173
151174
152175# Database model
153176class Character (CharacterBase , table = True ):
154177 id : uuid .UUID = Field (default_factory = uuid .uuid4 , primary_key = True )
178+
155179 status : CharacterStatus = Field (default = CharacterStatus .PENDING )
156- creator_id : uuid .UUID = Field (foreign_key = "user.id" , nullable = False )
180+
181+ total_messages : int = Field (default = 0 )
157182
183+
184+ creator_id : uuid .UUID = Field (foreign_key = "user.id" , nullable = False )
158185 creator : User = Relationship (back_populates = "created_characters" )
159186 conversations : list ["Conversation" ] = Relationship (back_populates = "character" )
160187
161-
162188# Properties to return via API
163189class CharacterPublic (CharacterBase ):
164190 id : uuid .UUID
165191 status : CharacterStatus
166192 creator_id : uuid .UUID
167193
194+
195+ total_messages : int
196+ created_at : datetime
197+
168198
169199class CharactersPublic (SQLModel ):
170200 data : list [CharacterPublic ]
0 commit comments