From a6d736f9296e24d0ecf266c39d855323ee8b74ff Mon Sep 17 00:00:00 2001 From: Abhay Ayare <168357471+AbhayAyare@users.noreply.github.com> Date: Wed, 30 Jul 2025 15:14:41 +0530 Subject: [PATCH] Update prompt.py Stricter classification prompt for DevRel triage (fixes #93) --- backend/app/classification/prompt.py | 29 +++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/app/classification/prompt.py b/backend/app/classification/prompt.py index 5b458d3b..99c0f19f 100644 --- a/backend/app/classification/prompt.py +++ b/backend/app/classification/prompt.py @@ -1,26 +1,29 @@ -DEVREL_TRIAGE_PROMPT = """Analyze this message to determine if it needs DevRel assistance. +DEVREL_TRIAGE_PROMPT = """ +Analyze this message to determine if it needs DevRel assistance. Message: {message} Context: {context} -DevRel handles: -- Technical questions about projects/APIs -- Developer onboarding and support -- Bug reports and feature requests -- Community discussions about development -- Documentation requests -- General developer experience questions +DevRel should be triggered ONLY if: +- The user explicitly mentions or tags the DevRel AI bot (e.g., "@Devr.AI", "@devrel", etc.) +- The message is a direct question about setting up the project, contributing, build/runtime errors, or anything clearly about this repository’s development. +- The user asks about documentation, onboarding, or GitHub issues/PRs in this repo. + +DO NOT trigger DevRel for: +- General conversation, greetings, or unrelated chat +- Messages between users that do NOT mention the bot Respond ONLY with JSON: -{{ +{ "needs_devrel": true/false, "priority": "high|medium|low", "reasoning": "brief explanation" -}} +} Examples: -- "How do I contribute?" → {{"needs_devrel": true, "priority": "high", "reasoning": "Onboarding question"}} -- "What's for lunch?" → {{"needs_devrel": false, "priority": "low", "reasoning": "Not development related"}} -- "API is throwing errors" → {{"needs_devrel": true, "priority": "high", "reasoning": "Technical support needed"}} +- "@Devr.AI how do I build this?" → {"needs_devrel": true, "priority": "high", "reasoning": "Explicitly tagged bot for setup help"} +- "Hi everyone!" → {"needs_devrel": false, "priority": "low", "reasoning": "General greeting"} +- "I’m getting an error installing requirements.txt" → {"needs_devrel": true, "priority": "high", "reasoning": "Direct technical setup issue"} +- "Who wants coffee?" → {"needs_devrel": false, "priority": "low", "reasoning": "Not development related"} """