🎲 Added probabilistic scheduler and 📋 future roadmap checklist for Delta AI bot

This commit is contained in:
milo 2025-05-09 21:07:22 -04:00
parent c751b7613e
commit 9753f508d1
6 changed files with 108 additions and 32 deletions

View file

@ -89,7 +89,7 @@ A structured build plan for developing and deploying the AlphaBot Discord compan
- [x] Build `!roast @user` with AI-generated replies - [x] Build `!roast @user` with AI-generated replies
- [x] Style roast output with selected personality - [x] Style roast output with selected personality
- [x] Add cooldown to prevent spam (optional) - [x] Add cooldown to prevent spam (optional)
- [ ] Fix Emojis (optional) - [x] Fix Emojis (optional) --- I think this is now fixed
- Emojis from the settings.yml file are broken. Please fix - Emojis from the settings.yml file are broken. Please fix
--- ---
@ -100,14 +100,14 @@ A structured build plan for developing and deploying the AlphaBot Discord compan
#### ✅ Core Features #### ✅ Core Features
- [ ] Replace static messages in `scheduler.py` with AI-generated ones via `get_ai_response()` - [x] Replace static messages in `scheduler.py` with AI-generated ones via `get_ai_response()`
- Use prompt like: *“Post something sassy, attention-grabbing, or chaotic to wake up the server.”* - Use prompt like: *“Post something sassy, attention-grabbing, or chaotic to wake up the server.”*
- Maintain current persona system for tone consistency - Maintain current persona system for tone consistency
- [ ] Add `settings.yml` option to control post mode: - [x] Add `settings.yml` option to control post mode:
- `mode: preset` static messages only - `mode: preset` static messages only
- `mode: ai` generate new message via LLM - `mode: ai` generate new message via LLM
- `mode: mixed` random chance between the two - ~~`mode: mixed` random chance between the two~~
- [ ] Log each scheduled post and mode used for debugging - [ ] ~~Log each scheduled post and mode used for debugging~~ - Pushed back, not a critical feature right now
--- ---
@ -115,16 +115,16 @@ A structured build plan for developing and deploying the AlphaBot Discord compan
> Post when it feels "natural" low chance at first, rising over time. > Post when it feels "natural" low chance at first, rising over time.
- [ ] Add `probabilistic_scheduler.py` or integrate into `scheduler.py` - [x] Add `probabilistic_scheduler.py` or integrate into `scheduler.py`
- [ ] Configurable parameters: - [x] Configurable parameters:
- `start_chance: 0.05` (5% per hour) - `start_chance: 0.05` (5% per hour)
- `increase_per_hour: 0.05` - `increase_per_hour: 0.05`
- `decay_on_post: 0.02` - `decay_on_post: 0.02`
- [ ] Reset chance after post, store `last_post_time` - [x] ~~Reset chance after post, store `last_post_time`~~ (this is using probability decay which is a bit better)
--- ---
#### 💤 Inactivity-Aware Scheduler (Mode 3 Stretch Goal) ~~#### 💤 Inactivity-Aware Scheduler (Mode 3 Stretch Goal)~~ (Temporarily Passed, Probabilistic scheduler is really good for now)
> Posts when the **server** or a **user** has been inactive for too long. > Posts when the **server** or a **user** has been inactive for too long.
@ -191,25 +191,46 @@ This final step removes the need for runtime prompt injection by turning Delta i
--- ---
### 🎨 Polish & Bonus features ### ✅ MVP Features (Core Bot Experience)
These are the must-have features to make the bot functional, fun, and engaging.
- [ ] Bot appears on the server like a "user" (ability to @delta instead of "!chat") - [ ] **Bot appears on the server like a "user"** (ability to @delta instead of `!chat`)
- helps the "sell" the idea to others that the bot is a "friend" - [ ] **Bot is user aware**
- All user interactions apply to the bot so other users dont need to remmember special commands - Usernames are passed to the bot along with prompts
- [ ] Have the bot be content aware - [ ] **Have the bot be content aware**
- pulls the existing conversation and talks about stuff that is inline with the topics - Pulls ongoing conversations to respond in context
- [ ] Give bot ability to react to mesages like users would - [ ] **Give bot ability to react to messages like users would**
- adds a personal touch and helps sell the idea of it being your "friend" more - [ ] 🗓️ **Scheduled specific times/dates**
- does need some sort of content awareness - Daily messages, birthdays, holidays, etc.
- [ ] Bot can be given some power to change the server a bit - [ ] 💤 **Inactivity-based triggers**
- keeps thing fresh, makes it so that there is some change happening in servers - Post when the server gets too quiet to re-engage users
- the idea being it makes the bot more unique by providing more tailored experiences
- [ ] Bot is user aware
- usernames are passed to the bot along side the users prompt
- [ ] Image interpretation
- bot can read images like GPT this allows for more personalised interactions
- [ ] Web usage
- Bot can search the web like GPT or OpenWebUI
- Opens up a ton of interactivity for memes, media discussion, an be easily integrated with multiple platforms
*Progress last updated: May 8, 2025* ---
## 🎨 Polish & Bonus features
### 🛠️ Phase 2 Features (Personality, Social Layer, Engagement)
These enhance immersion and build emotional or social connection.
- [ ] **Bot can be given some power to change the server a bit**
- Occasional channel renames, topic changes, etc.
- [ ] 🧠 **Context-aware scheduling**
- Posts based on ongoing server activity
- [ ] 📊 **Rate-based adjustment**
- Increase frequency during hype, back off when people are chatting naturally
- [ ] **Web usage**
- Search memes, respond to trending topics, pull from APIs like Reddit/Twitter
---
### 🧠 Advanced AI & Multimodal Features
For immersion and automation lovers. These make Delta truly feel alive.
- [ ] **Image interpretation**
- Understands memes, screenshots, or selfies (local AI or API-driven)
- [ ] **Content-aware moderation assist**
- Alert mods or intervene when heated discussions arise
- [ ] **Integrated personality shift**
- Switch behavior based on server activity, holidays, or mood triggers
*Progress last updated: May 9, 2025*

View file

@ -1,6 +1,10 @@
# __init__.py formaly know as scheduler.py
import os import os
import yaml import yaml
import asyncio import asyncio
import random
from ai import get_ai_response
from . import simple, probabilistic, inactivity from . import simple, probabilistic, inactivity
def load_settings(): def load_settings():
@ -18,12 +22,39 @@ async def start_scheduler(bot):
return return
mode = scheduler_settings.get("mode", "simple").lower() mode = scheduler_settings.get("mode", "simple").lower()
print(f"🕒 Delta Scheduler started in {mode.upper()} mode.")
if mode == "simple": if mode == "simple":
await simple.run(bot, scheduler_settings, settings) await simple.run(bot, scheduler_settings, settings)
elif mode == "probabilistic": elif mode == "probabilistic":
await probabilistic.run(bot, scheduler_settings, settings) # Setup and loop
probabilistic.setup(scheduler_settings["probabilistic"])
interval = scheduler_settings.get("interval_minutes", 5)
use_ai = scheduler_settings.get("use_ai", True)
channel = bot.get_channel(scheduler_settings["channel_id"])
await bot.wait_until_ready()
while not bot.is_closed():
if probabilistic.should_post(scheduler_settings["probabilistic"]):
if use_ai:
prompt = "Post a short chaotic or motivational message in the voice of Delta, the RGB catgirl."
message = get_ai_response(prompt)
else:
message = random.choice(scheduler_settings.get("messages", ["Hello from Delta."]))
await channel.send(message)
print(f"📤 Scheduled message sent to #{channel.name}: {message}")
probabilistic.on_post(scheduler_settings["probabilistic"])
await asyncio.sleep(interval * 60)
elif mode == "inactivity": elif mode == "inactivity":
await inactivity.run(bot, scheduler_settings, settings) await inactivity.run(bot, scheduler_settings, settings)
else: else:
print(f"❓ Unknown scheduler mode: {mode}") print(f"❓ Unknown scheduler mode: {mode}")

View file

@ -0,0 +1,24 @@
import random
import datetime
from ai import get_ai_response
last_post_time = None
post_chance = None
def setup(settings):
global last_post_time, post_chance
last_post_time = datetime.datetime.utcnow()
post_chance = settings.get("start_chance", 0.05)
def should_post(settings):
global post_chance
if random.random() < post_chance:
return True
post_chance += settings.get("increase_per_interval", 0.05)
return False
def on_post(settings):
global post_chance, last_post_time
post_chance -= settings.get("decay_on_post", 0.02)
post_chance = max(post_chance, 0.01)
last_post_time = datetime.datetime.utcnow()

View file

@ -8,8 +8,8 @@ messages:
scheduler: scheduler:
enabled: true enabled: true
mode: simple # <- this activates simple mode mode: probabilistic # <- this activates simple mode
interval_minutes: 0.25 # <- post every 60 minutes interval_minutes: 1 # <- post every 60 minutes
use_ai: true # <- true = use LLM, false = use static messages use_ai: true # <- true = use LLM, false = use static messages
channel_id: 1370420592360161393 # <- your Discord text channel ID channel_id: 1370420592360161393 # <- your Discord text channel ID