47 lines
1.5 KiB
Python
47 lines
1.5 KiB
Python
from typing import List, Literal, Optional
|
|
from uuid import uuid4
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class Character(BaseModel):
|
|
id: str = Field(default_factory=lambda: str(uuid4()))
|
|
name: str
|
|
description: str = ""
|
|
traits: List[str] = [] # Характер, привычки
|
|
appearance: str = "" # Внешность
|
|
role: Literal["protagonist", "antagonist", "supporting", "minor"] = "supporting"
|
|
|
|
|
|
class Location(BaseModel):
|
|
id: str = Field(default_factory=lambda: str(uuid4()))
|
|
name: str
|
|
description: str = ""
|
|
atmosphere: str = "" # Атмосфера, ощущения
|
|
type: Literal["city", "building", "nature", "interior", "other"] = "other"
|
|
|
|
|
|
class Event(BaseModel):
|
|
id: str = Field(default_factory=lambda: str(uuid4()))
|
|
title: str
|
|
description: str = ""
|
|
chapter: Optional[str] = None # В какой главе произошло
|
|
importance: Literal["major", "minor", "background"] = "minor"
|
|
|
|
|
|
class StoryThread(BaseModel):
|
|
id: str = Field(default_factory=lambda: str(uuid4()))
|
|
title: str
|
|
description: str = ""
|
|
status: Literal["active", "resolved", "abandoned"] = "active"
|
|
related_characters: List[str] = [] # ID персонажей
|
|
related_events: List[str] = [] # ID событий
|
|
|
|
|
|
class StoryBible(BaseModel):
|
|
characters: List[Character] = []
|
|
locations: List[Location] = []
|
|
events: List[Event] = []
|
|
threads: List[StoryThread] = []
|
|
last_updated: Optional[str] = None # ISO timestamp
|