Post "Reply" #10

Open
opened 2025-05-11 14:00:53 -04:00 by milo · 2 comments
Owner

🧠 Autochat Features (v1.3)

Passive Engagement Logic

  • Trigger-based attention: Delta activates when trigger words (name/nicknames or persona keywords) are detected.
  • Engagement score: Gradually decays if Delta isn’t explicitly called.
  • Probability model: Uses a rolling chance to continue engagement after being triggered.

Context-Aware Responses

  • Pulls recent messages based on:
    • context.enabled: toggle from settings.yml
    • context.max_messages: max messages to include in prompt context
  • Skips replies if Delta just responded twice in a row (prevents double-talking)

Reaction Behavior (New)

  • Emoji reaction support: Delta reacts with emojis from the latest message
  • Chance-based reaction trigger: Only reacts some of the time (default: 0.35)
  • Personality-aware emoji logic planned (future)

Cooldown Support

  • AUTOREPLY_COOLDOWN set via environment variable (default: 60s)
  • Prevents overposting and respects server pacing

🔧 maybe_react_to_message() (autochat.py)

async def maybe_react_to_message(message, persona):
    if not ENABLE_REACTIONS:
        return

    # 🔢 Get chance from settings.yml
    reaction_chance = SETTINGS.get("autochat", {}).get("reaction_chance", 0.35)
    roll = random.random()

    # 🎲 Skip reactions if roll fails
    if roll > reaction_chance:
        logger.info(f"🎲 Reaction skipped (chance {reaction_chance:.2f}, roll {roll:.2f})")
        return

    # 🔍 Extract emojis from message text (Unicode ranges)
    import re
    emojis = re.findall(r'[\U0001F300-\U0001F6FF\U0001F900-\U0001F9FF\U0001F1E0-\U0001F1FF]', message.content)
    unique_emojis = list(dict.fromkeys(emojis))

    # ✅ React with up to 3 emojis
    if unique_emojis:
        try:
            for emoji in unique_emojis[:3]:
                await message.add_reaction(emoji)
        except Exception as e:
            logger.warning(f"⚠️ Failed to add reaction: {e}")
# 🧠 Autochat Features (v1.3) ## ✅ Passive Engagement Logic - **Trigger-based attention:** Delta activates when trigger words (name/nicknames or persona keywords) are detected. - **Engagement score:** Gradually decays if Delta isn’t explicitly called. - **Probability model:** Uses a rolling chance to continue engagement after being triggered. ## ✅ Context-Aware Responses - Pulls recent messages based on: - `context.enabled`: toggle from `settings.yml` - `context.max_messages`: max messages to include in prompt context - Skips replies if Delta just responded twice in a row (prevents double-talking) ## ✅ Reaction Behavior (New) - **Emoji reaction support:** Delta reacts with emojis from the latest message - **Chance-based reaction trigger:** Only reacts some of the time (default: `0.35`) - **Personality-aware emoji logic** planned (future) ## ✅ Cooldown Support - `AUTOREPLY_COOLDOWN` set via environment variable (default: `60s`) - Prevents overposting and respects server pacing --- ## 🔧 `maybe_react_to_message()` (autochat.py) ```python async def maybe_react_to_message(message, persona): if not ENABLE_REACTIONS: return # 🔢 Get chance from settings.yml reaction_chance = SETTINGS.get("autochat", {}).get("reaction_chance", 0.35) roll = random.random() # 🎲 Skip reactions if roll fails if roll > reaction_chance: logger.info(f"🎲 Reaction skipped (chance {reaction_chance:.2f}, roll {roll:.2f})") return # 🔍 Extract emojis from message text (Unicode ranges) import re emojis = re.findall(r'[\U0001F300-\U0001F6FF\U0001F900-\U0001F9FF\U0001F1E0-\U0001F1FF]', message.content) unique_emojis = list(dict.fromkeys(emojis)) # ✅ React with up to 3 emojis if unique_emojis: try: for emoji in unique_emojis[:3]: await message.add_reaction(emoji) except Exception as e: logger.warning(f"⚠️ Failed to add reaction: {e}")
milo added the
enhancement
label 2025-05-11 14:00:53 -04:00
milo self-assigned this 2025-05-11 14:00:53 -04:00
milo added this to the Polishing Phase project 2025-05-11 14:00:53 -04:00
milo added
💡feature
and removed
enhancement
labels 2025-05-11 14:30:05 -04:00
milo added this to the Alpha Build Ready milestone 2025-05-11 17:49:20 -04:00
Author
Owner

Mostly done, May need some tuning

Mostly done, May need some tuning
Author
Owner

Mostly working but it doesn't have the reply feature yet. This is upcoming though

Mostly working but it doesn't have the `reply` feature yet. This is upcoming though
Sign in to join this conversation.
No description provided.