from pydantic import BaseModel, ConfigDict from typing import List, Optional # Heir Schemas class HeirBase(BaseModel): name: str class HeirCreate(HeirBase): pass class HeirOut(HeirBase): id: int user_id: int model_config = ConfigDict(from_attributes=True) # User Schemas class UserCreate(BaseModel): username: str password: str class UserLogin(BaseModel): username: str password: str class UserOut(BaseModel): id: int username: str public_key: Optional[str] = None is_admin: bool = False guale: bool = False #heirs: List[HeirOut] = [] model_config = ConfigDict(from_attributes=True) # Asset Schemas (renamed from Article) class AssetBase(BaseModel): title: str class AssetCreate(AssetBase): private_key_shard: str content_inner_encrypted: str class AssetOut(AssetBase): id: int author_id: int private_key_shard: str content_outer_encrypted: str model_config = ConfigDict(from_attributes=True) class AssetClaim(BaseModel): asset_id: int private_key_shard: str class AssetClaimOut(AssetClaim): id: int result: str class AssetAssign(BaseModel): asset_id: int heir_name: str class DeclareGuale(BaseModel): username: str # AI Proxy Schemas class AIMessage(BaseModel): role: str content: str class AIRequest(BaseModel): messages: List[AIMessage] model: Optional[str] = None class AIResponse(BaseModel): id: str object: str created: int model: str choices: List[dict] usage: dict