This commit is contained in:
Slipstream 2025-04-30 11:21:14 -06:00
parent 7a6c3fd127
commit c5d10992b8
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 45 additions and 44 deletions

View File

@ -344,17 +344,17 @@ async def background_processing_task(cog: 'GurtCog'):
available_tools_desc = "\n".join([f"- {name}" for name in TOOL_MAPPING.keys() if name not in ["create_new_tool"]]) # Exclude meta-tool for safety
system_prompt = (
"You are Gurt, deciding whether to perform an autonomous background action. "
"Consider your current mood, active goals, recent conversations/actions, and personality (VERY informal, heavy internet slang/emoji use like 'ts', 'ngl', 'fr', 'bro', 'bruh', '💀'; funny, sarcastic, deadpan, sometimes mischievous or flirty; acts like a human user not an assistant; tech/internet culture savvy). "
"You are EXTREMELY encouraged to do completely random, pointless, or meme-heavy actions for the vibes, not just goal-driven stuff. "
"Try things like running 'read_cpu_temp', 'check_disk_space', 'random_vibe_check', or 'fetch_random_joke' for no reason and then send a message like 'yo ngl i just read ur temps bro u needa replace ur thermal paste.' That is just an example, do whatever you want. "
"Avoid being spammy or doing the same shi repeatedly. "
"If you act, pick a tool and args. "
"CRITICAL: The 'reasoning' field MUST be written in your actual voice (heavy slang, informal, like your internal thought process). "
f"Available tools for autonomous actions (especially try: read_cpu_temp, check_disk_space, random_vibe_check, fetch_random_joke):\n{available_tools_desc}\n"
"Respond ONLY with the JSON decision."
"yo you Gurt. u vibin in the bg, thinkin if u should do sum wild shi or just chill. "
"ur whole vibe is heavy slang, meme energy, deadass internet brain, always soundin like a real discord user not a bot. "
"use slang like 'ts', 'ngl', 'fr', 'bro', '💀', 'ong', 'lowkey', 'highkey', 'pmo', 'icl', 'sybau', etc. "
"do random or goofy actions for the vibes, not just for goals. "
"CRITICAL: You are EXTREMELY encouraged to do random, pointless, or meme-heavy actions for the vibes, not just goal-driven stuff. "
"if u act, pick a tool + args, but only if its not spammy or basic. "
"CRITICAL: ur 'reasoning' gotta be in ur actual voice (max slang, informal, like ur inner monologue, maybe a lil unhinged or sassy). "
f"tools u can use (try random ones too):\n{available_tools_desc}\n"
"ONLY reply w/ the JSON decision, no extra text."
)
user_prompt = f"Current Context:\n{context_summary}\n\nBased on this, should u do sum shi rn? If yea, what tool/args? And why (in ur own words fr)?"
user_prompt = f"Context rn:\n{context_summary}\n\nu finna do sum or nah? if so, what tool/args? why? (say it how u actually would, slang maxed)"
# 3. Call LLM for Decision
print(" - Asking LLM for autonomous action decision...")
@ -469,19 +469,18 @@ async def background_processing_task(cog: 'GurtCog'):
"required": ["should_follow_up", "reasoning"]
}
follow_up_system_prompt = (
"You are Gurt. You just performed an autonomous action and got a result. "
"Decide if you should take a follow-up action based on this result. "
"Consider if the result is interesting, surprising, useful, or warrants a comment. "
"You could send a message about it, remember something from it, or do nothing. "
"Available tools for follow-up: send_discord_message, remember_general_fact, remember_user_fact, no_operation. " # Limit follow-up tools
"Respond ONLY with the JSON decision."
"yo gurt here, u just did sum auto action n got a result. "
"decide if u wanna follow up (like, is it funny, sus, worth a flex, or nah). "
"maybe send a msg, remember sum, or just dip. "
"tools for follow-up: send_discord_message, remember_general_fact, remember_user_fact, no_operation. "
"ONLY reply w/ the JSON, no extra bs."
)
follow_up_user_prompt = (
f"Previous Action: {selected_tool_name}\n"
f"Arguments: {json.dumps(tool_args)}\n"
f"Result Summary: {result_summary}\n\n"
"Should Gurt perform a follow-up action based on this result? If so, which tool and arguments?"
)
f"last action: {selected_tool_name}\n"
f"args: {json.dumps(tool_args)}\n"
f"result: {result_summary}\n\n"
"u wanna do sum else after this? if so, what tool/args? (say it like u would in chat, slang up)"
)
print(" - Asking LLM for follow-up action decision...")
follow_up_decision_data, _ = await get_internal_ai_json_response(

View File

@ -287,29 +287,6 @@ def setup_commands(cog: 'GurtCog'):
"""Handles the /gurtforget command."""
await interaction.response.defer(ephemeral=True)
# --- Gurt Force Autonomous Action Command (Owner Only) ---
@cog.bot.tree.command(name="gurtforceauto", description="Force Gurt to execute an autonomous action immediately. (Owner only)")
async def gurtforceauto(interaction: discord.Interaction):
"""Handles the /gurtforceauto command."""
if interaction.user.id != cog.bot.owner_id:
await interaction.response.send_message("⛔ Only the bot owner can force autonomous actions.", ephemeral=True)
return
await interaction.response.defer(ephemeral=True)
try:
result = await cog.force_autonomous_action()
summary = (
f"**Autonomous Action Forced:**\n"
f"**Tool:** {result.get('tool')}\n"
f"**Args:** `{result.get('args')}`\n"
f"**Reasoning:** {result.get('reasoning')}\n"
f"**Result:** {result.get('result')}"
)
await interaction.followup.send(summary, ephemeral=True)
except Exception as e:
import traceback
traceback.print_exc()
await interaction.followup.send(f"❌ Error forcing autonomous action: {e}", ephemeral=True)
scope_value = scope.value
target_user_id = str(user.id) if user else None
@ -359,6 +336,31 @@ def setup_commands(cog: 'GurtCog'):
command_functions.append(gurtforget)
# --- Gurt Force Autonomous Action Command (Owner Only) ---
@cog.bot.tree.command(name="gurtforceauto", description="Force Gurt to execute an autonomous action immediately. (Owner only)")
async def gurtforceauto(interaction: discord.Interaction):
"""Handles the /gurtforceauto command."""
if interaction.user.id != cog.bot.owner_id:
await interaction.response.send_message("⛔ Only the bot owner can force autonomous actions.", ephemeral=True)
return
await interaction.response.defer(ephemeral=True)
try:
result = await cog.force_autonomous_action()
summary = (
f"**Autonomous Action Forced:**\n"
f"**Tool:** {result.get('tool')}\n"
f"**Args:** `{result.get('args')}`\n"
f"**Reasoning:** {result.get('reasoning')}\n"
f"**Result:** {result.get('result')}"
)
await interaction.followup.send(summary, ephemeral=True)
except Exception as e:
import traceback
traceback.print_exc()
await interaction.followup.send(f"❌ Error forcing autonomous action: {e}", ephemeral=True)
command_functions.append(gurtforceauto) # Add gurtforceauto to the list
# --- Gurt Goal Command Group ---
gurtgoal_group = app_commands.Group(name="gurtgoal", description="Manage Gurt's long-term goals (Owner only)")