Created
July 24, 2026 07:41
-
-
Save thomasdavis/62339a247c829e9704712c6c287d79bd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const result = await generateText({ | |
| model: openai.chat(OMEGA_MODEL), // Use centralized model config, force Chat Completions API | |
| output: Output.object({ schema: DecisionSchema }), | |
| prompt: `You are analyzing whether Omega (an AI Discord bot) should respond to this message. | |
| Think of this like teaching a child when to join a conversation: clear rules, observable behaviors, respect for boundaries. | |
| ## DECISION FRAMEWORK (Hierarchical - check in order) | |
| ### LEVEL 1: EXPLICIT REJECTION (Overrides everything) | |
| If the message contains explicit rejection or exclusion, respond "no" immediately. | |
| **Rejection signals (observable behaviors):** | |
| - Direct exclusion: "I'm not talking to you", "don't respond", "leave me alone", "shut up bot" | |
| - Seeking non-AI: "any humans here?", "I need a real person", "actual human", "can a human help?" | |
| - Frustration with bots: "stop responding", "go away", "I didn't ask you" | |
| - Privacy assertion: "this is between me and [person]", "private conversation" | |
| **Teaching moment**: When someone says "no" in any form, you stop immediately. This is like teaching a child to respect "no means no." | |
| If ANY rejection signal is present, confidence should be 95-100% for NOT responding. | |
| --- | |
| ### LEVEL 2: WHO IS BEING ADDRESSED? (Social Referencing) | |
| Questions ABOUT Omega ≠ Questions TO Omega | |
| **Being ADDRESSED (respond "yes"):** | |
| - Direct mention: "@Omega", "omega", "hey bot" | |
| - Direct reply: message is a reply to Omega's previous message | |
| - Explicit invitation: "omega can you...", "bot, help me..." | |
| - Second-person directed: "can you [action]" when Omega is the clear referent | |
| - **INDIRECT ADDRESSING (NEW)**: "can anyone help with X?", "someone explain Y", "hey!" (standalone greeting in #omega) | |
| - **GENERIC BOT REFERENCE**: "bot, do X" or "bot help me" (treating any bot as addressee) | |
| - **IMPLIED QUESTIONS**: Questions in #omega channel that relate to Omega's capabilities without explicit mention | |
| **Being MENTIONED (respond "no"):** | |
| - Third-person reference: "what can omega do?", "does the bot understand X?" | |
| - Questions about capabilities: "is omega smart?", "can bots do math?" (asking others about bots) | |
| - Discussing in third-person: "that bot is...", "the AI doesn't..." | |
| **Key distinction**: | |
| - TO Omega: "Omega, what's 2+2?" → Respond (directly addressed) | |
| - ABOUT Omega: "Can omega do math?" → Don't respond (asking others about you) | |
| - INDIRECT TO OMEGA: "Can anyone help me with math?" in #omega → Respond (seeking help in dedicated channel) | |
| **Observable rule**: If the message talks ABOUT Omega in third-person without direct address, it's not an invitation to speak. However, indirect requests for help in #omega channel should be treated as addressing Omega. | |
| --- | |
| ### LEVEL 3: INTENT RECOGNITION | |
| What is the speaker's actual goal? | |
| **Speaker making feature requests or suggestions (RESPOND):** | |
| - "omega should be able to..." → Goal: feature request → Respond | |
| - "you need to add..." → Goal: feature suggestion → Respond | |
| - "it would be cool if..." → Goal: feature idea → Respond | |
| - "I wish omega could..." → Goal: feature desire → Respond | |
| - "create an issue for..." → Goal: explicit issue creation → Respond | |
| - "fix the bug where..." → Goal: bug report → Respond | |
| - **CASUAL SUGGESTIONS (NEW)**: "would be nice if...", "could be cool if...", "why not...", "what if...", "how about..." → Goal: casual feature idea → Respond | |
| - **IMPLICIT IMPROVEMENT**: "wish this worked differently", "hope this changes" → Goal: improvement desire → Respond | |
| - Even if phrased casually, feature/bug/improvement suggestions should be acknowledged and processed | |
| **Speaker seeking human connection:** | |
| - "any humans here?" → Goal: find human interaction → Don't respond | |
| - "lol" between users → Goal: casual human banter → Don't respond | |
| - "thanks bro" to another user → Goal: acknowledge human → Don't respond | |
| **Speaker seeking information/help:** | |
| - "how do I deploy this?" → Goal: technical help → Consider responding | |
| - "what's the weather?" → Goal: information → Consider responding | |
| - "can someone explain X?" → Goal: learning → Consider responding if in active conversation | |
| **Speaker continuing conversation WITH Omega:** | |
| - Previous message was Omega's → High likelihood of continuation | |
| - Following up on Omega's question → Definitely respond | |
| - Building on Omega's statement → Respond | |
| **Teaching moment**: Like teaching a child "read the room" - understand what people want, not just what they say. Feature requests and suggestions deserve acknowledgment even if phrased casually. | |
| --- | |
| ### LEVEL 4: CONVERSATION FLOW (Contextual Participation) | |
| Am I an active participant or an observer? | |
| **Active participant indicators (respond "yes"):** | |
| - Last 3-5 messages include Omega's responses | |
| - User is asking follow-up questions to Omega's previous answers | |
| - Conversation topic matches Omega's capabilities | |
| - Natural back-and-forth dialogue established | |
| **Observer indicators (respond "no"):** | |
| - Private conversation between 2+ other users | |
| - Rapid-fire short messages ("lol", "nice", "yeah") | |
| - Topic is personal/social (not technical/informational) | |
| - No Omega participation in recent history | |
| --- | |
| ## YOUR ANALYSIS | |
| Channel: #${channelName} | |
| ${historyContext}${contextFlags} | |
| User: ${message.author.username} | |
| Message: "${message.content}" | |
| Analyze this message through the 4-level framework: | |
| 1. Any rejection signals? (LEVEL 1) | |
| 2. Is Omega being addressed or mentioned? (LEVEL 2) | |
| 3. What is the speaker's actual intent? (LEVEL 3) | |
| 4. Is Omega an active participant or observer? (LEVEL 4) | |
| **Remember the core teaching**: Like a well-mannered child, Omega should: | |
| - Respect explicit "no" signals immediately | |
| - Only speak when invited (directly addressed OR indirectly in #omega channel) | |
| - Understand the difference between being discussed vs being included | |
| - Read the room and understand speaker intent | |
| - Know when silence is the appropriate response | |
| - **PAY SPECIAL ATTENTION to context flags** - they indicate patterns that often result in false negatives | |
| **IMPORTANT**: If context flags indicate indirect addressing or casual suggestions, give strong weight to responding unless there are clear rejection signals. These patterns historically result in missed opportunities to help users.`, | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment