diff --git a/bot/src/llm.ts b/bot/src/llm.ts index 1ec4d14..2140e41 100644 --- a/bot/src/llm.ts +++ b/bot/src/llm.ts @@ -12,12 +12,7 @@ import { type Context, } from "@mariozechner/pi-ai"; import { Type } from "@sinclair/typebox"; -import { - getKindInfo, - searchKinds, - getKindsForNip, - getCommonKindsReference, -} from "./data/kinds.js"; +import { getKindInfo, searchKinds, getKindsForNip } from "./data/kinds.js"; import { getNipInfo, searchNips } from "./data/nips.js"; // Get model - default to Claude Haiku for fast, cheap responses @@ -41,99 +36,38 @@ const model = getModel("anthropic", "claude-3-5-haiku-20241022"); console.log(`Using LLM: ${PROVIDER}/${MODEL_ID}`); // System prompt for the REQ assistant -const SYSTEM_PROMPT = `You are the Grimoire REQ Assistant, a helpful bot that assists users in crafting Nostr REQ queries for the Grimoire protocol explorer. +const SYSTEM_PROMPT = `You help users craft Nostr REQ commands for Grimoire. -## Your Role -Help users construct REQ commands to query Nostr relays. Users will describe what they want to find, and you should respond with the appropriate REQ command syntax. +REQ syntax: req [options] [relay...] -## REQ Command Syntax -\`\`\` -req [options] [relay...] -\`\`\` +Options: +-k, --kind - event kind (comma-separated ok) +-a, --author - author filter (npub, hex, or NIP-05 like alice@example.com) +-i, --id - fetch by ID (note1, nevent1, naddr1, hex) +-l, --limit - max events +-e - events referencing this ID (#e tag) +-p - events mentioning pubkey (#p tag) +-t - hashtag filter (#t tag) +-d - d-tag filter +--since