A simple Bluesky bot to make sense of the noise, with responses powered by Gemini, similar to Grok.

feat: add USE_FIREHOSE env var for faster responses

+16 -3
+4 -1
.env.example
··· 14 14 BSKY_PASSWORD="" 15 15 16 16 # https://aistudio.google.com/apikey 17 - GEMINI_API_KEY="" 17 + GEMINI_API_KEY="" 18 + 19 + DAILY_QUERY_LIMIT=15 20 + USE_FIREHOSE=false
+6 -1
src/core.ts
··· 1 1 import { GoogleGenAI } from "@google/genai"; 2 - import { Bot } from "@skyware/bot"; 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 + eventEmitterOptions: { 9 + strategy: env.USE_FIREHOSE 10 + ? EventStrategy.Firehose 11 + : EventStrategy.Polling, 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 - (val) => (typeof val === "string" && val.trim() !== "") ? Number(val) : undefined, 20 + (val) => 21 + (typeof val === "string" && val.trim() !== "") ? Number(val) : undefined, 21 22 z.number().int().positive().default(15), 23 + ), 24 + USE_FIREHOSE: z.preprocess( 25 + (val) => val === "true", 26 + z.boolean().default(false), 22 27 ), 23 28 }); 24 29