Spaces:
Sleeping
Sleeping
| """์ฑํฐ ๋ฉํ YAML ์คํค๋ง โ content/chapters/*.yaml. | |
| ending_rules์ condition์ trust_score/doubt_score ๋ณ์๋ง ์ฐ๋ ๋น๊ต์ ๋ฌธ์์ด. | |
| ํ๊ฐ(ํ์ฑยทํ์ )๋ services/story.py์ ๊ฒฐ์ ์ ์ฝ๋๊ฐ ๋ด๋นํ๋ค (LLM ํ์ ๊ธ์ง). | |
| """ | |
| from __future__ import annotations | |
| from typing import Optional | |
| from pydantic import BaseModel, ConfigDict, Field | |
| class EndingRule(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| id: str | |
| label: str | |
| condition: str # ์: "doubt_score >= 30" / "default" | |
| canonical: bool = False | |
| description: str = "" | |
| priority: int = 0 # ๋ฎ์์๋ก ๋จผ์ ํ๊ฐ. default๋ ๋ง์ง๋ง | |
| class RCardRef(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| id: str | |
| trigger: str # identity_direct | weapon | |
| description: str = "" | |
| class BeatRange(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| start: str # "E01" | |
| end: str # "E06" | |
| class Chapter(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| id: str | |
| title: str = "" | |
| summary: str = "" | |
| entry_beat: str # "E01-01" | |
| beat_range: BeatRange | |
| ending_rules: list[EndingRule] | |
| canon_rules: list[str] = Field(default_factory=list) | |
| r_cards: list[RCardRef] = Field(default_factory=list) | |
| pocket_max_turns: int = 6 # ๊ฐ์ ํฌ์ผ ์์ ์ฑํ ํด ์ํ (๊ฐ์ ์๋ ด) | |
| page_target_chars: int = 850 # ํ์ด์ง ๋ณํฉ ๋ชฉํ ๊ธ์ ์ โ ํ ์คํธ ํ๋ฉด์ ๊ฐ๋ ์ฑ์ฐ๋ ๊ธฐ์ค | |
| # (ํ๋ก ํธ๊ฐ ๋ทฐํฌํธ ์ค์ธก์ผ๋ก ๋ค์ ํ๋ฉด ๋ถํ ํ๋ฏ๋ก, ํฌ๊ฒ ์ก์์๋ก ํ๋ฉด์ด ์์ฐจ๊ฒ ์ฑ์์ง๋ค) | |
| class ChapterFile(BaseModel): | |
| model_config = ConfigDict(extra="forbid") | |
| chapter: Chapter | |