Auto-generate an adventure outline when no adventure text is provided
When a player creates a game without pasting their own adventure, the DM previously improvised turn-by-turn with no overall arc, ending, or calibrated difficulty. Now the setup-chat interview generates a full outline (hook, three-to-four-part structure, milestone leveling, explicit ending condition, GM guidance) as a follow-up LLM call once genre/length/experience are known, and feeds it through the existing adventure_text -> RAG ingestion -> "follow strictly" pipeline exactly like a pasted adventure. Falls back silently to today's improvised behavior if generation fails. Verified end-to-end in the browser: setup interview -> outline generated and previewed -> game created -> RAG chunks ingested -> has_adventure true -> cascade-cleaned on delete. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,11 @@ def get_game_setup_prompt() -> str:
|
||||
return (PROMPTS_DIR / "game_setup_prompt.txt").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_adventure_outline_prompt() -> str:
|
||||
return (PROMPTS_DIR / "adventure_outline_prompt.txt").read_text(encoding="utf-8")
|
||||
|
||||
|
||||
@lru_cache
|
||||
def get_llm_client() -> AsyncOpenAI:
|
||||
if settings.llm_provider == "lmstudio":
|
||||
|
||||
Reference in New Issue
Block a user