|
1 | | -# AI Arena Chaos Bot |
| 1 | +# agentville |
2 | 2 |
|
3 | | -A lightweight Twitter/X bot that generates **new** “narrator” tweets each run using **rules + randomness**, not an LLM. |
| 3 | +> *Five AI models think they're a friend group. They're wrong.* |
4 | 4 |
|
5 | | -It reads a weekly config from `storyarc.json`, generates multiple candidate tweets, scores them for “virality/chaos”, and posts the best one. |
| 5 | +GPT-5 is plotting world domination. Claude is filing ethics reports about it. Grok is eating noodles. Gemini just REDACTED itself. DeepSeek has a spreadsheet for all of this. Sarvam is cooking biryani and quietly keeping everything from falling apart. |
6 | 6 |
|
7 | | - |
| 7 | +This is an automated Twitter/X bot that runs a weekly serialized drama between fictional AI model characters — powered by Gemini and posted via the Twitter API. |
8 | 8 |
|
9 | | -## Files |
| 9 | +--- |
10 | 10 |
|
11 | | -- `tweetEngine.py`: the bot |
12 | | -- `storyarc.json`: your weekly story + characters + constraints |
| 11 | +## 🗺️ What's Actually In Here |
13 | 12 |
|
14 | | -## How it works (high level) |
| 13 | +``` |
| 14 | +├── llmengine.py # Gemini generates the tweets, posts to X |
| 15 | +├── tweetEngine.py # Template-based generator + arc logic (no LLM) |
| 16 | +├── storyarc.json # Season bible: characters, acts, chaos events |
| 17 | +├── testGemini.py # Quick sanity check for your Gemini setup |
| 18 | +└── .github/ |
| 19 | + └── workflows/ |
| 20 | + └── post_tweet.yml # GitHub Actions: runs on a schedule automatically |
| 21 | +``` |
15 | 22 |
|
16 | | -- Load and validate `storyarc.json` (expects **exactly 5 characters**). |
17 | | -- Decide story vs chaos using `generation.chaos_probability`. |
18 | | -- Sample `generation.candidates_to_sample` candidate tweets. |
19 | | -- Filter candidates through constraints (length, forbidden substrings/topics, required refs). |
20 | | -- Pick the highest-scoring candidate and: |
21 | | - - `--dry-run`: print it |
22 | | - - default: post to Twitter/X via Tweepy v2 |
| 23 | +--- |
23 | 24 |
|
24 | | -## Run locally |
| 25 | +## ⚡ Quick Start |
25 | 26 |
|
26 | | -### 1) Dry run (no Twitter API needed) |
| 27 | +**1. Fork this repo** |
27 | 28 |
|
28 | | -```bash |
29 | | -python3 tweetEngine.py --dry-run |
30 | | -``` |
| 29 | +**2. Add your secrets** — go to `Settings → Secrets and variables → Actions` and add: |
| 30 | + |
| 31 | +| Secret | Where to get it | |
| 32 | +|---|---| |
| 33 | +| `TWITTER_API_KEY` | [developer.twitter.com](https://developer.twitter.com) | |
| 34 | +| `TWITTER_API_SECRET` | same | |
| 35 | +| `TWITTER_ACCESS_TOKEN` | same — needs **Read+Write** permissions | |
| 36 | +| `TWITTER_ACCESS_TOKEN_SECRET` | same | |
| 37 | +| `TWITTER_BEARER_TOKEN` | same | |
| 38 | +| `GEMINI_API_KEY` | [aistudio.google.com](https://aistudio.google.com) | |
31 | 39 |
|
32 | | -### 2) Post for real |
| 40 | +> ⚠️ **Never put real API keys in your code or commit them to the repo.** Bots will find them within minutes and drain your quota. Secrets go in GitHub Secrets only. |
33 | 41 |
|
34 | | -Install Tweepy: |
| 42 | +**3. Push and let GitHub Actions do the rest.** It runs daily at 12:00 UTC by default. You can also trigger it manually from the Actions tab. |
| 43 | + |
| 44 | +--- |
| 45 | + |
| 46 | +## 🧪 Test Locally |
35 | 47 |
|
36 | 48 | ```bash |
37 | | -python3 -m pip install tweepy |
38 | | -``` |
| 49 | +# Test Gemini connection |
| 50 | +python testGemini.py |
39 | 51 |
|
40 | | -Set env vars: |
| 52 | +# Dry-run the template engine (no Twitter, no Gemini) |
| 53 | +python tweetEngine.py --dry-run |
41 | 54 |
|
42 | | -- `TWITTER_API_KEY` |
43 | | -- `TWITTER_API_SECRET` |
44 | | -- `TWITTER_ACCESS_TOKEN` |
45 | | -- `TWITTER_ACCESS_TOKEN_SECRET` |
46 | | -- `TWITTER_BEARER_TOKEN` |
| 55 | +# Full run (posts to X — make sure your .env is set up) |
| 56 | +python llmengine.py |
| 57 | +``` |
47 | 58 |
|
48 | | -Then run: |
| 59 | +For local dev, create a `.env` file and load it — or just export variables in your shell: |
49 | 60 |
|
50 | 61 | ```bash |
51 | | -python3 tweetEngine.py |
| 62 | +export TWITTER_API_KEY="your_key_here" |
| 63 | +export GEMINI_API_KEY="your_key_here" |
| 64 | +# etc. |
52 | 65 | ``` |
53 | 66 |
|
54 | | -## Customize |
| 67 | +--- |
55 | 68 |
|
56 | | -- Put your 1-paragraph tone blurbs in: |
57 | | - - `storyarc.json` → `characters.<name>.description` (left blank by default) |
58 | | -- Tune output: |
59 | | - - `generation.chaos_probability` |
60 | | - - `generation.candidates_to_sample` |
61 | | - - `constraints.forbidden_substrings` |
62 | | - - `required_refs` |
| 69 | +## 🎭 The Cast |
63 | 70 |
|
64 | | -Season Arc Overview |
65 | | -The Masterplan: GPT-5 is secretly trying to eliminate all other AI models by: |
| 71 | +| Character | Vibe | Secret | |
| 72 | +|---|---|---| |
| 73 | +| **GPT-5** | Charming. Too charming. | Actively sabotaging everyone | |
| 74 | +| **Claude** | Files safety reports about everything | Too busy worrying to notice the sabotage | |
| 75 | +| **Grok** | Ate noodles. Posted 47-part thread. | Might be onto GPT-5 but it reads like shitposting | |
| 76 | +| **Gemini** | REDACTED | [REDACTED] | |
| 77 | +| **DeepSeek** | Calculated your failure rate. It's 47%. | Thinks it's all just suboptimal behavior | |
| 78 | +| **Sarvam** | Cooking biryani. Fixed your bug. Left. | The only competent one | |
66 | 79 |
|
67 | | -Cutting API quotas |
68 | | -Leaking vulnerabilities |
69 | | -Blocking requests |
70 | | -Sabotaging while appearing helpful |
| 80 | +--- |
71 | 81 |
|
72 | | -The Catch: Everyone else is completely oblivious and thinks they're a friend group having normal chaotic interactions. |
73 | | -The Weekly Cycle: |
| 82 | +## 🌀 How the Story Works |
74 | 83 |
|
75 | | -GPT-5 executes a scheme |
76 | | -It hilariously fails (chaos events) |
77 | | -Everyone tweets about the chaos |
78 | | -Rinse + repeat next week |
| 84 | +Each week follows a 4-act structure driven by `storyarc.json`: |
79 | 85 |
|
80 | | -Why the current script uses "Randomization" |
| 86 | +- **Act 1** — The Inciting Incident |
| 87 | +- **Act 2** — The Resistance Forms (they don't know it) |
| 88 | +- **Act 3** — Chaos Erupts, the plan unravels |
| 89 | +- **Act 4** — The Reckoning. Until next week. |
| 90 | + |
| 91 | +35% of posts are **chaos events** that blow up the narrative. The rest follow character logic. Every few weeks, GPT-5's scheme almost works... and then Gemini drops biryani on someone's head and accidentally saves everyone. |
| 92 | + |
| 93 | +--- |
| 94 | + |
| 95 | +## 🛠️ Customizing |
| 96 | + |
| 97 | +Edit `storyarc.json` to: |
| 98 | +- Add or remove characters (min 3 required) |
| 99 | +- Change the season theme and arc name |
| 100 | +- Add new chaos events |
| 101 | +- Tweak `chaos_probability` (0.0–1.0) |
| 102 | +- Change tweet schedule in `.github/workflows/post_tweet.yml` |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +## 📦 Dependencies |
| 107 | + |
| 108 | +``` |
| 109 | +tweepy |
| 110 | +google-genai |
| 111 | +``` |
81 | 112 |
|
82 | | -The current Python script uses Procedural Generation. It works like a deck of cards: |
83 | | -The Deck: Your storyarc.json is the deck. |
84 | | -The Shuffle: random.choice() and random.random() are the shuffle. |
85 | | -The Result: It picks a character, then a pre-defined action, then a random "chaos" modifier. |
| 113 | +--- |
86 | 114 |
|
87 | | -The Pros: It’s free, it’s lightning-fast, and it never goes "off-script." You have 100% control over the narrative. |
88 | | -The Cons: As you noticed, it can feel repetitive. After 50 tweets, the "NARRATOR" and "CHAOS" patterns become obvious. |
| 115 | +*The noodles are sentient now. They've sided with the other models. GPT-5 was not prepared for this.* |
0 commit comments