Junhoee's picture
Upload 98 files
f646e0b verified
Raw
History Blame Contribute Delete
1.47 kB
"""์ฑ•ํ„ฐ ๋ฉ”ํƒ€ 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 # ๊ฐœ์ž… ํฌ์ผ“ ์ž์œ ์ฑ„ํŒ… ํ„ด ์ƒํ•œ (๊ฐ•์ œ ์ˆ˜๋ ด)
class ChapterFile(BaseModel):
model_config = ConfigDict(extra="forbid")
chapter: Chapter