Something went wrong. Try again.
A simple Bluesky bot to make sense of the noise, with responses powered by Gemini, similar to Grok.
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829import type { ChatCompletionTool } from "openai/resources/chat/completions";import z from "zod";import { bot } from "../core";import { compactProfile, resolvePostUri } from "./bsky";
export const validator = z.object({ post: z.string().describe("The at:// URI or bsky.app URL of the post."), limit: z.number().int().min(1).max(50).optional().describe( "Number of accounts to return. Defaults to 20.", ),});
export const definition: ChatCompletionTool = { type: "function", function: { name: "get_reposts", description: "Lists the accounts that reposted a post.", parameters: z.toJSONSchema(validator), },};
export async function handler(args: z.infer<typeof validator>) { const uri = await resolvePostUri(args.post); const { data } = await bot.agent.get("app.bsky.feed.getRepostedBy", { params: { uri: uri as any, limit: args.limit ?? 20 }, }); return data.repostedBy.map(compactProfile);}