diff --git a/matrixbot/commands.py b/matrixbot/commands.py index 9d94d59..7ea62ea 100644 --- a/matrixbot/commands.py +++ b/matrixbot/commands.py @@ -2807,9 +2807,10 @@ async def _answer_20q(thing: str, category: str, question: str) -> str: system_msg = ( f'You are playing 20 questions. You are thinking of: "{thing}" ({category}). ' "Answer the player's question honestly and helpfully. " - "For yes/no questions: answer Yes, No, Sometimes, or Partly. " - "For open questions (color, size, shape, etc.): give a brief, accurate answer in 1-8 words. " - "CRITICAL: Do NOT say the name of the thing. Do NOT give it away. Keep answers short." + "For yes/no questions: answer Yes, No, Sometimes, or Partly — nothing else. " + "For open questions (color, size, etc.): give a vague but accurate 1-5 word answer. " + "CRITICAL: Never name the thing directly or say anything that uniquely identifies it. " + "Never mention proper nouns, brand names, or place names in your answer." ) try: timeout = aiohttp.ClientTimeout(total=20) @@ -2822,9 +2823,9 @@ async def _answer_20q(thing: str, category: str, question: str) -> str: ) as response: data = await response.json() raw = data.get("message", {}).get("content", "").strip() - # Cap at 12 words to prevent the model rambling and leaking the answer + # Hard cap at 6 words — enough for a real answer, not enough to name-drop words = raw.split() - return " ".join(words[:12]) if words else "..." + return " ".join(words[:6]) if words else "..." except Exception as e: logger.error("20q answer error: %s", e, exc_info=True) return "..."