rename BALL_MODEL -> CREATIVE_MODEL
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:
+13
-13
@@ -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
@@ -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"))
|
||||||
|
|||||||
Reference in New Issue
Block a user