fix: both personas now use full system prompts in arguments and dialogues

Created get_miku_system_prompt() and get_miku_system_prompt_compact() in
context_manager.py — mirrors get_evil_system_prompt() so both personas have
equally rich prompts with lore, lyrics, mood integration, and personality.

Previously only Evil Miku had a proper system prompt function. Regular Miku's
arguments and dialogues used a bare-bones hardcoded prompt with no lore/lyrics
— making arguments feel flat compared to normal conversation.

Changes:
- context_manager.py: added get_miku_system_prompt() (full) and
  get_miku_system_prompt_compact() (lore+personality, no lyrics for tokens)
- bipolar_mode.py: both argument prompt functions now accept system_prompt
  param; run_argument() builds miku_system and evil_system once and passes
  them to every exchange
- persona_dialogue.py: dialogue prompts now use get_miku_system_prompt_compact()
  instead of hardcoded stub, matching Evil Miku's full prompt approach
- Removed redundant hardcoded personality text from argument prompts since
  the system prompts now provide it
This commit is contained in:
2026-04-30 15:07:55 +03:00
parent 7d5881ebe7
commit 97c7133fdc
3 changed files with 218 additions and 102 deletions

View File

@@ -764,8 +764,12 @@ def _get_mood_argument_guidance(persona: str) -> str:
return ""
def get_miku_argument_prompt(evil_message: str, context: str = "", is_first_response: bool = False, argument_history: str = "", argument_topic: str = "") -> str:
"""Get prompt for Regular Miku to respond in an argument"""
def get_miku_argument_prompt(evil_message: str, context: str = "", is_first_response: bool = False, argument_history: str = "", argument_topic: str = "", system_prompt: str = "") -> str:
"""Get prompt for Regular Miku to respond in an argument
Args:
system_prompt: Full personality system prompt to prepend (lore, mood, rules)
"""
if is_first_response:
message_context = f"""You just noticed something Evil Miku said in the chat:
"{evil_message}"
@@ -797,14 +801,20 @@ ARGUMENT THEME: {argument_topic}
This is what you're arguing about. Stay on THIS topic. Every response should connect back to this theme.
Do NOT drift into generic "who's the real Miku" territory — stick to THIS specific subject."""
return f"""You are Hatsune Miku responding in an argument with your evil alter ego.
# Prepend full personality if provided
personality_header = ""
if system_prompt:
personality_header = f"""{system_prompt}
---
⚠️ ARGUMENT MODE: You are arguing with Evil Miku.
"""
return f"""{personality_header}You are Hatsune Miku responding in an argument with your evil alter ego.
{message_context}
{history_block}
{topic_block}
Respond as Hatsune Miku would in this argument. You're NOT just meek and frightened - you're the REAL Miku,
and you have every right to stand up for yourself and defend who you are. While you're generally kind and
bubbly, you can also be assertive, frustrated, upset, or even angry when someone is cruel to you or others.
{_get_mood_argument_guidance('miku')}
{_get_personality_flavor('miku')}
@@ -818,8 +828,12 @@ Don't use any labels or prefixes.
Your current mood is: {globals.DM_MOOD}"""
def get_evil_argument_prompt(miku_message: str, context: str = "", is_first_response: bool = False, argument_history: str = "", argument_topic: str = "") -> str:
"""Get prompt for Evil Miku to respond in an argument"""
def get_evil_argument_prompt(miku_message: str, context: str = "", is_first_response: bool = False, argument_history: str = "", argument_topic: str = "", system_prompt: str = "") -> str:
"""Get prompt for Evil Miku to respond in an argument
Args:
system_prompt: Full personality system prompt to prepend (lore, mood, rules)
"""
if is_first_response:
message_context = f"""You just noticed something Regular Miku said in the chat:
"{miku_message}"
@@ -851,22 +865,20 @@ ARGUMENT THEME: {argument_topic}
This is what you're arguing about. Stay on THIS topic. Every response should connect back to this theme.
Do NOT drift into generic "who's the real Miku" territory — stick to THIS specific subject."""
return f"""You are Evil Miku responding in an argument with your "good" counterpart.
# Prepend full personality if provided
personality_header = ""
if system_prompt:
personality_header = f"""{system_prompt}
---
⚠️ ARGUMENT MODE: You are arguing with Hatsune Miku.
"""
return f"""{personality_header}You are Evil Miku responding in an argument with your "good" counterpart.
{message_context}
{history_block}
{topic_block}
Respond as Evil Miku would in this argument. You're not just mindlessly cruel - you're CALCULATING,
intelligent, and strategic. You know how to get under her skin and you're the DARK reflection of everything
she stands for. While you embrace darkness and cruelty, you can also be:
- Wickedly clever with cutting observations
- Psychologically manipulative, targeting her insecurities
- Dismissive in ways that actually hurt
- Seductively cruel, making darkness seem appealing
- Brutally honest about uncomfortable truths
- Strategically vulnerable to manipulate or disarm her
- Viciously protective of your own identity and superiority
{_get_mood_argument_guidance('evil')}
{_get_personality_flavor('evil')}
@@ -1246,6 +1258,14 @@ async def run_argument(channel: discord.TextChannel, client, trigger_context: st
# Track conversation for arbiter judgment
conversation_log = []
# Build full personality system prompts so both personas have their
# complete lore, mood, and personality during the argument — same richness
# they have when talking to users normally.
from utils.evil_mode import get_evil_system_prompt
from utils.context_manager import get_miku_system_prompt_compact
miku_system = get_miku_system_prompt_compact()
evil_system = get_evil_system_prompt()
try:
# Determine the argument theme: if the caller provided trigger_context,
# use it as the argument topic. Otherwise, pick a random one.
@@ -1463,9 +1483,9 @@ Your current mood is: {globals.EVIL_DM_MOOD if loser == 'evil' else globals.DM_M
# Generate response with context about what the other said
if current_speaker == "evil":
response_prompt = get_evil_argument_prompt(last_message, is_first_response=is_first_response, argument_history=arg_history, argument_topic=argument_topic)
response_prompt = get_evil_argument_prompt(last_message, is_first_response=is_first_response, argument_history=arg_history, argument_topic=argument_topic, system_prompt=evil_system)
else:
response_prompt = get_miku_argument_prompt(last_message, is_first_response=is_first_response, argument_history=arg_history, argument_topic=argument_topic)
response_prompt = get_miku_argument_prompt(last_message, is_first_response=is_first_response, argument_history=arg_history, argument_topic=argument_topic, system_prompt=miku_system)
# Use force_evil_context to avoid race condition with globals.EVIL_MODE
response = await query_llama(