rename BALL_MODEL -> CREATIVE_MODEL
Lint / Shell (shellcheck) (push) Successful in 9s
Lint / JS (eslint) (push) Successful in 6s
Lint / Python (ruff) (push) Successful in 6s
Lint / Python deps (pip-audit) (push) Successful in 42s
Lint / Secret scan (gitleaks) (push) Successful in 6s

It's used for 8ball, roasts, riddles, WYR, and debate — not just the
magic 8-ball anymore. CREATIVE_MODEL better reflects its role as the
uncensored/abliterated model for creative generation tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 21:58:20 -04:00
parent 66f761b466
commit a254bb9381
2 changed files with 14 additions and 14 deletions
+13 -13
View File
@@ -15,7 +15,7 @@ from utils import send_text, send_html, send_reaction, edit_html, sanitize_input
from wordle import handle_wordle from wordle import handle_wordle
from config import ( from config import (
MAX_DICE_SIDES, MAX_DICE_COUNT, BOT_PREFIX, ADMIN_USERS, MAX_DICE_SIDES, MAX_DICE_COUNT, BOT_PREFIX, ADMIN_USERS,
OLLAMA_URL, OLLAMA_MODEL, BALL_MODEL, ASK_MODEL, COOLDOWN_SECONDS, OLLAMA_URL, OLLAMA_MODEL, CREATIVE_MODEL, ASK_MODEL, COOLDOWN_SECONDS,
MINECRAFT_RCON_HOST, MINECRAFT_RCON_PORT, MINECRAFT_RCON_PASSWORD, MINECRAFT_RCON_HOST, MINECRAFT_RCON_PORT, MINECRAFT_RCON_PASSWORD,
RCON_TIMEOUT, MIN_USERNAME_LENGTH, MAX_USERNAME_LENGTH, RCON_TIMEOUT, MIN_USERNAME_LENGTH, MAX_USERNAME_LENGTH,
) )
@@ -276,7 +276,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/chat", f"{OLLAMA_URL}/api/chat",
json={ json={
"model": BALL_MODEL, "model": CREATIVE_MODEL,
"stream": False, "stream": False,
"messages": [ "messages": [
{"role": "system", "content": system_msg}, {"role": "system", "content": system_msg},
@@ -299,7 +299,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
html = ( html = (
f'<font color="#f59e0b"><strong>🎱 {answer}</strong></font><br>' f'<font color="#f59e0b"><strong>🎱 {answer}</strong></font><br>'
f'<sup><em>{args}</em></sup>' f'<sup><em>{args}</em></sup>'
+ (f'<br><sup><em>via {_model_label(BALL_MODEL)}</em></sup>' if used_llm else "") + (f'<br><sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>' if used_llm else "")
+ (f'<br><sup><em>[debug] prompt: {q_for_prompt}</em></sup>' if debug else "") + (f'<br><sup><em>[debug] prompt: {q_for_prompt}</em></sup>' if debug else "")
) )
await send_html(client, room_id, plain, html) await send_html(client, room_id, plain, html)
@@ -489,7 +489,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
async with aiohttp.ClientSession(timeout=timeout) as session: async with aiohttp.ClientSession(timeout=timeout) as session:
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/generate", f"{OLLAMA_URL}/api/generate",
json={"model": BALL_MODEL, "prompt": prompt, "stream": False}, json={"model": CREATIVE_MODEL, "prompt": prompt, "stream": False},
) as response: ) as response:
data = await response.json() data = await response.json()
raw = _normalize_caps(data.get("response", "").strip()) raw = _normalize_caps(data.get("response", "").strip())
@@ -513,7 +513,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
html = ( html = (
f'<font color="{_answer_color}"><strong>🎱 {answer}</strong></font><br>' f'<font color="{_answer_color}"><strong>🎱 {answer}</strong></font><br>'
f'<sup><em>{args}</em></sup>' f'<sup><em>{args}</em></sup>'
+ (f'<br><sup><em>via {_model_label(BALL_MODEL)}</em></sup>' if used_llm else "") + (f'<br><sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>' if used_llm else "")
+ (f'<br><sup><em>[debug] prompt: {q_for_prompt}</em></sup>' if debug else "") + (f'<br><sup><em>[debug] prompt: {q_for_prompt}</em></sup>' if debug else "")
) )
await send_html(client, room_id, plain, html) await send_html(client, room_id, plain, html)
@@ -543,7 +543,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/generate", f"{OLLAMA_URL}/api/generate",
json={ json={
"model": BALL_MODEL, "model": CREATIVE_MODEL,
"prompt": ( "prompt": (
"You are the magic 8-ball. Give a short, creative, one-sentence prediction in response to the question. " "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. " "Your answer should feel like a fortune — mysterious, slightly cryptic, or funny. "
@@ -566,7 +566,7 @@ async def cmd_8ball(client: AsyncClient, room_id: str, sender: str, args: str):
html = ( html = (
f'<font color="{_answer_color}"><strong>🎱 {answer}</strong></font><br>' f'<font color="{_answer_color}"><strong>🎱 {answer}</strong></font><br>'
f'<sup><em>{args}</em></sup>' f'<sup><em>{args}</em></sup>'
+ (f'<br><sup><em>via {_model_label(BALL_MODEL)}</em></sup>' if used_llm else "") + (f'<br><sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>' if used_llm else "")
+ (f'<br><sup><em>[debug] prompt: {question}</em></sup>' if debug else "") + (f'<br><sup><em>[debug] prompt: {question}</em></sup>' if debug else "")
) )
await send_html(client, room_id, plain, html) await send_html(client, room_id, plain, html)
@@ -1680,7 +1680,7 @@ async def _generate_wyr() -> dict | None:
async with aiohttp.ClientSession(timeout=timeout) as session: async with aiohttp.ClientSession(timeout=timeout) as session:
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/chat", f"{OLLAMA_URL}/api/chat",
json={"model": BALL_MODEL, "stream": False, "messages": messages}, json={"model": CREATIVE_MODEL, "stream": False, "messages": messages},
) as response: ) as response:
data = await response.json() data = await response.json()
text = data.get("message", {}).get("content", "").strip() text = data.get("message", {}).get("content", "").strip()
@@ -1728,7 +1728,7 @@ async def cmd_wyr(client: AsyncClient, room_id: str, sender: str, args: str):
f'🅰️ <strong>{wyr["option_a"]}</strong><br>' f'🅰️ <strong>{wyr["option_a"]}</strong><br>'
f'🅱️ <strong>{wyr["option_b"]}</strong><br><br>' f'🅱️ <strong>{wyr["option_b"]}</strong><br><br>'
f'<em>React with 🅰️ or 🅱️ — results in 30 seconds!</em><br>' f'<em>React with 🅰️ or 🅱️ — results in 30 seconds!</em><br>'
f'<sup><em>via {_model_label(BALL_MODEL)}</em></sup>' f'<sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>'
) )
resp = await send_html(client, room_id, plain, html) resp = await send_html(client, room_id, plain, html)
@@ -1817,7 +1817,7 @@ async def _generate_riddle() -> dict | None:
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/chat", f"{OLLAMA_URL}/api/chat",
json={ json={
"model": BALL_MODEL, "model": CREATIVE_MODEL,
"stream": False, "stream": False,
"messages": [ "messages": [
{"role": "system", "content": system_msg}, {"role": "system", "content": system_msg},
@@ -1876,7 +1876,7 @@ async def cmd_riddle(client: AsyncClient, room_id: str, sender: str, args: str):
f'<font color="#14b8a6"><strong>🧩 Riddle!</strong></font><br>' f'<font color="#14b8a6"><strong>🧩 Riddle!</strong></font><br>'
f'<blockquote>{riddle}</blockquote>' f'<blockquote>{riddle}</blockquote>'
f'<em>Type your answer in chat — 60 seconds on the clock!</em><br>' f'<em>Type your answer in chat — 60 seconds on the clock!</em><br>'
f'<sup><em>via {_model_label(BALL_MODEL)}</em></sup>' f'<sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>'
) )
await send_html(client, room_id, plain, html) await send_html(client, room_id, plain, html)
@@ -2012,7 +2012,7 @@ async def cmd_roast(client: AsyncClient, room_id: str, sender: str, args: str):
async with session.post( async with session.post(
f"{OLLAMA_URL}/api/chat", f"{OLLAMA_URL}/api/chat",
json={ json={
"model": BALL_MODEL, "model": CREATIVE_MODEL,
"stream": False, "stream": False,
"messages": [ "messages": [
{"role": "system", "content": system_msg}, {"role": "system", "content": system_msg},
@@ -2033,7 +2033,7 @@ async def cmd_roast(client: AsyncClient, room_id: str, sender: str, args: str):
html = ( html = (
f'<font color="#ef4444"><strong>🔥 Roasting {display_name}...</strong></font><br>' f'<font color="#ef4444"><strong>🔥 Roasting {display_name}...</strong></font><br>'
f'<blockquote>{roast}</blockquote>' f'<blockquote>{roast}</blockquote>'
f'<sup><em>via {_model_label(BALL_MODEL)}</em></sup>' f'<sup><em>via {_model_label(CREATIVE_MODEL)}</em></sup>'
) )
await send_html(client, room_id, plain, html) await send_html(client, room_id, plain, html)
+1 -1
View File
@@ -19,7 +19,7 @@ LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# Integrations # Integrations
OLLAMA_URL = os.getenv("OLLAMA_URL", "http://10.10.10.157:11434") OLLAMA_URL = os.getenv("OLLAMA_URL", "http://10.10.10.157:11434")
OLLAMA_MODEL = os.getenv("OLLAMA_MODEL", "phi4-mini:latest") OLLAMA_MODEL = os.getenv("OLLAMA_MODEL", "phi4-mini:latest")
BALL_MODEL = os.getenv("BALL_MODEL", "huihui_ai/llama3.2-abliterate:3b") CREATIVE_MODEL = os.getenv("CREATIVE_MODEL", "huihui_ai/llama3.2-abliterate:3b")
ASK_MODEL = os.getenv("ASK_MODEL", "phi4-mini:latest") ASK_MODEL = os.getenv("ASK_MODEL", "phi4-mini:latest")
MINECRAFT_RCON_HOST = os.getenv("MINECRAFT_RCON_HOST", "10.10.10.67") MINECRAFT_RCON_HOST = os.getenv("MINECRAFT_RCON_HOST", "10.10.10.67")
MINECRAFT_RCON_PORT = int(os.getenv("MINECRAFT_RCON_PORT", "25575")) MINECRAFT_RCON_PORT = int(os.getenv("MINECRAFT_RCON_PORT", "25575"))