tangled
alpha
login
or
join now
indexx.dev
/
aero
9
fork
atom
A simple Bluesky bot to make sense of the noise, with responses powered by Gemini, similar to Grok.
9
fork
atom
overview
issues
3
pulls
pipelines
feat: add USE_FIREHOSE env var for faster responses
indexx.dev
4 months ago
f237f339
df5933cb
+16
-3
3 changed files
expand all
collapse all
unified
split
.env.example
src
core.ts
env.ts
+4
-1
.env.example
···
14
14
BSKY_PASSWORD=""
15
15
16
16
# https://aistudio.google.com/apikey
17
17
-
GEMINI_API_KEY=""
17
17
+
GEMINI_API_KEY=""
18
18
+
19
19
+
DAILY_QUERY_LIMIT=15
20
20
+
USE_FIREHOSE=false
+6
-1
src/core.ts
···
1
1
import { GoogleGenAI } from "@google/genai";
2
2
-
import { Bot } from "@skyware/bot";
2
2
+
import { Bot, EventStrategy } from "@skyware/bot";
3
3
import { env } from "./env";
4
4
5
5
export const bot = new Bot({
6
6
service: env.SERVICE,
7
7
emitChatEvents: true,
8
8
+
eventEmitterOptions: {
9
9
+
strategy: env.USE_FIREHOSE
10
10
+
? EventStrategy.Firehose
11
11
+
: EventStrategy.Polling,
12
12
+
},
8
13
});
9
14
10
15
export const ai = new GoogleGenAI({
+6
-1
src/env.ts
···
17
17
18
18
GEMINI_API_KEY: z.string(),
19
19
DAILY_QUERY_LIMIT: z.preprocess(
20
20
-
(val) => (typeof val === "string" && val.trim() !== "") ? Number(val) : undefined,
20
20
+
(val) =>
21
21
+
(typeof val === "string" && val.trim() !== "") ? Number(val) : undefined,
21
22
z.number().int().positive().default(15),
23
23
+
),
24
24
+
USE_FIREHOSE: z.preprocess(
25
25
+
(val) => val === "true",
26
26
+
z.boolean().default(false),
22
27
),
23
28
});
24
29