8ball: constrain general responses to actual yes/no/maybe style
The creative model was producing fortune-cookie mysticism ("navigate
the curve of fate") instead of 8-ball answers. New system prompt
explicitly requires YES/NO/UNCERTAIN category answers, 2-6 words,
funny and direct — no cryptic prophecies.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+16
-8
@@ -542,20 +542,28 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
|
||||
timeout = aiohttp.ClientTimeout(total=30)
|
||||
async with aiohttp.ClientSession(timeout=timeout) as session:
|
||||
async with session.post(
|
||||
f"{OLLAMA_URL}/api/generate",
|
||||
f"{OLLAMA_URL}/api/chat",
|
||||
json={
|
||||
"model": CREATIVE_MODEL,
|
||||
"prompt": (
|
||||
"You are the magic 8-ball. Give a short, creative, one-sentence prediction in response to the question. "
|
||||
"Your answer should feel like a fortune — mysterious, slightly cryptic, or funny. "
|
||||
"Do not repeat the question. Do not start with 'I'. One sentence only. Give only your prediction.\n\n"
|
||||
f"Question: {question}"
|
||||
),
|
||||
"stream": False,
|
||||
"messages": [
|
||||
{
|
||||
"role": "system",
|
||||
"content": (
|
||||
"You are a magic 8-ball. You respond to yes/no questions with short, witty 8-ball style answers. "
|
||||
"Your answer must clearly be a YES, NO, or UNCERTAIN/MAYBE type response — "
|
||||
"like 'Signs point to yes', 'Not a chance', 'Ask again when you're sober', "
|
||||
"'Absolutely not', 'Obviously yes', 'The universe says nope', 'Seems unlikely', 'Sure, why not'. "
|
||||
"Be funny and direct. 2-6 words max. Never be cryptic or mystical. Never give a fortune or prophecy. "
|
||||
"No first person. No questions back. Just the answer."
|
||||
),
|
||||
},
|
||||
{"role": "user", "content": f"Question: {question}"},
|
||||
],
|
||||
},
|
||||
) as response:
|
||||
data = await response.json()
|
||||
raw = _normalize_caps(data.get("response", "").strip())
|
||||
raw = _normalize_caps(data.get("message", {}).get("content", "").strip())
|
||||
if _is_valid_8ball_response(raw):
|
||||
answer = raw
|
||||
_answer_color = "#f59e0b"
|
||||
|
||||
Reference in New Issue
Block a user