the little dino terror bot of irc
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: increase likelihood to join convos

dunkirk.sh 2df5d7c9 c8a25d02

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