from app.llm import prompts def test_fragment_system_carries_fiction_framing_not_paranormal_claim(): system = prompts.fragment_system("a spirit box", "en") assert "horror art installation" in system assert "single word" in system assert "Spanish" not in system def test_spanish_language_clause_applied(): assert "Spanish" in prompts.fragment_system("a spirit box", "es") assert "Spanish" in prompts.wire_system("es") assert "Spanish" in prompts.chat_system({"name": "X"}, "es") def test_chat_prompt_formats_history_and_question(): prompt = prompts.chat_prompt( "Are you at peace?", [ {"role": "user", "text": "Who are you?"}, {"role": "spirit", "text": "A voice in the wires."}, ], ) assert "Seeker: Who are you?" in prompt assert "Spirit: A voice in the wires." in prompt assert prompt.rstrip().endswith("Spirit:") def test_mint_prompt_requests_exact_json_keys(): prompt = prompts.mint_prompt("abcdef0123456789", "evp", "[]", ["lessac", "ryan"]) for key in ('"name"', '"epithet"', '"persona"', '"rarity"', '"voice"', '"visual"', '"quotes"'): assert key in prompt assert "lessac, ryan" in prompt