Skip to content

Commit ed7b9c1

Browse files
committed
final
1 parent 38c93b9 commit ed7b9c1

File tree

5 files changed

+276
-173
lines changed

5 files changed

+276
-173
lines changed

.github/workflows/automate.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
name: agentville
1+
name: 🤖 AI Arena - Post Tweet
22

33
on:
4-
schedule:
5-
- cron: "47,50 17 * * *"
6-
- cron: "0 18 * * *"
7-
# - cron: "0 2,13,17 * * *"
8-
workflow_dispatch:
4+
schedule: s
5+
- cron: "0 2,13,17 * * *"
6+
workflow_dispatch:
97

108
jobs:
11-
chaos-tweet:
9+
post-tweet:
1210
runs-on: ubuntu-latest
11+
1312
steps:
1413
- name: Checkout repo
1514
uses: actions/checkout@v4
16-
15+
1716
- name: Set up Python
1817
uses: actions/setup-python@v5
1918
with:
2019
python-version: "3.11"
21-
20+
2221
- name: Install dependencies
2322
run: pip install tweepy google-genai
2423

25-
# Note: We use the names you have in your GitHub Secrets
26-
- name: Run Chaos Engine
24+
- name: Run LLM tweet engine
2725
env:
28-
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
29-
GEMINI_MODEL_NAME: "gemini-2.0-flash"
26+
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
3027
TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
3128
TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
3229
TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }}
3330
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
34-
run: python llmEngine.py
31+
TWITTER_BEARER_TOKEN: ${{ secrets.TWITTER_BEARER_TOKEN }}
32+
run: python llmengine.py

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"cmake.sourceDirectory": "/Users/user/Desktop/agentVille/precice/examples/solverdummies/fortran"
3+
}

README.md

Lines changed: 86 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,115 @@
1-
# AI Arena Chaos Bot
1+
# agentville
22

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.*
44
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.
66

7-
![image](image.jpg)
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.
88

9-
## Files
9+
---
1010

11-
- `tweetEngine.py`: the bot
12-
- `storyarc.json`: your weekly story + characters + constraints
11+
## 🗺️ What's Actually In Here
1312

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+
```
1522

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+
---
2324

24-
## Run locally
25+
## ⚡ Quick Start
2526

26-
### 1) Dry run (no Twitter API needed)
27+
**1. Fork this repo**
2728

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) |
3139

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.
3341
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
3547

3648
```bash
37-
python3 -m pip install tweepy
38-
```
49+
# Test Gemini connection
50+
python testGemini.py
3951

40-
Set env vars:
52+
# Dry-run the template engine (no Twitter, no Gemini)
53+
python tweetEngine.py --dry-run
4154

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+
```
4758

48-
Then run:
59+
For local dev, create a `.env` file and load it — or just export variables in your shell:
4960

5061
```bash
51-
python3 tweetEngine.py
62+
export TWITTER_API_KEY="your_key_here"
63+
export GEMINI_API_KEY="your_key_here"
64+
# etc.
5265
```
5366

54-
## Customize
67+
---
5568

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
6370

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 |
6679

67-
Cutting API quotas
68-
Leaking vulnerabilities
69-
Blocking requests
70-
Sabotaging while appearing helpful
80+
---
7181

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
7483

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`:
7985

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+
```
81112

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+
---
86114

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

Comments
 (0)