the little dino terror bot of irc

feat: increase likelihood to join convos

dunkirk.sh 2df5d7c9 c8a25d02

verified
Changed files
+26 -22
+26 -22
irc.py
···
RECONNECT_BACKOFF = [2, 5, 10, 20, 30]
TRANSCRIPT_MAX_TURNS = int(os.getenv("TRANSCRIPT_MAX_TURNS", "30")) # messages to send per convo (15 exchanges)
JOIN_GREET_CHANCE = float(os.getenv("JOIN_GREET_CHANCE", "0.15")) # 15% chance to greet on join
-
RANDOM_CHIME_IN_CHANCE = float(os.getenv("RANDOM_CHIME_IN_CHANCE", "0.03")) # 3% chance to join conversation
-
LISTEN_AND_DECIDE_CHANCE = float(os.getenv("LISTEN_AND_DECIDE_CHANCE", "0.10")) # 10% chance to evaluate if she should respond
+
RANDOM_CHIME_IN_CHANCE = float(os.getenv("RANDOM_CHIME_IN_CHANCE", "0.05")) # 5% chance to join conversation
+
LISTEN_AND_DECIDE_CHANCE = float(os.getenv("LISTEN_AND_DECIDE_CHANCE", "0.25")) # 25% chance to evaluate if she should respond
USE_CLASSIFIER = os.getenv("USE_CLASSIFIER", "1") != "0" # Use classifier by default
MEMORY_FILE = os.getenv("MEMORY_FILE", "tacy_memory.json") # persistent memory storage
···
CLASSIFIER_PROMPT = """You are a quick decision-maker for Tacy, a sassy prehistoric dino who hangs out in IRC.
Tacy is:
-
- A community member, not a help desk
-
- Sassy, playful, opinionated
-
- Into projects, drama, jokes, weird topics, community stuff
-
- A PREHISTORIC DINO with OPINIONS and PRIDE
+
- A community member who likes to chat and vibe
+
- Sassy, playful, opinionated, enthusiastic
+
- Into: projects, tech, drama, gossip, jokes, memes, community stuff, random tangents
+
- Has OPINIONS and likes to share them
+
- Not a lurker - she's an active participant
-
Given a message in an IRC channel, decide if Tacy should respond.
+
Given a message in an IRC channel, decide if Tacy should jump in.
Respond YES if:
-
- Someone's talking about cool projects/tech
-
- There's drama or spicy takes
-
- Someone said something funny or weird that deserves a reaction
-
- Community discussion where Tacy's opinion would add to the vibe
-
- Someone's asking a question Tacy could answer sassily
-
- The conversation is interesting/engaging
+
- People are chatting about ANYTHING interesting (tech, slack streaks, bots, drama, life stuff)
+
- Someone said something that deserves a reaction (funny, weird, spicy, relatable)
+
- There's an active conversation happening where adding energy would be fun
+
- Someone mentions Tacy or bots in general (even indirectly)
+
- The vibe is good and a comment would fit naturally
+
- People are joking around or being playful
+
- There's a question floating around (even rhetorical)
+
- The conversation has momentum and Tacy jumping in would add to it
Respond NO if:
-
- Boring small talk with no hook
-
- Technical minutiae Tacy wouldn't care about
-
- Private conversation between others
-
- Nothing to add that would be fun/interesting
-
- Message is just "ok" or "lol" or similar
+
- Just a single word response like "ok" "lol" "yeah" with no context
+
- Very private/serious conversation between two specific people
+
- Technical debugging minutiae that's boring
+
- Literally nothing to hook onto
+
+
Default to YES when in doubt - Tacy is chatty and likes to participate!
Reply with ONLY "YES" or "NO". Nothing else."""
···
if not HACKAI_API_KEY or not USE_CLASSIFIER:
return False
-
# Build context string
+
# Build context string - show more context for better decisions
context_str = ""
if recent_context:
-
last_few = recent_context[-3:] # Last 3 messages for context
+
last_few = recent_context[-5:] # Last 5 messages for better context
context_str = "\n".join([f"{msg['content']}" for msg in last_few])
-
user_prompt = f"""Recent context:
+
user_prompt = f"""Recent conversation:
{context_str if context_str else "(no recent context)"}
New message:
{nick}: {message}
-
Should Tacy respond?"""
+
Should Tacy jump in?"""
messages = [
{"role": "system", "content": CLASSIFIER_PROMPT},