The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Stop AI from saying partner country is editable (#4329)
Pedro Ladeira406fe186028b
diff --git a/apps/web/lib/ai/build-system-prompt.ts b/apps/web/lib/ai/build-system-prompt.tsindex e8b53f0f90..623fc5d6ef 100644--- a/apps/web/lib/ai/build-system-prompt.ts+++ b/apps/web/lib/ai/build-system-prompt.ts@@ -27,6 +27,7 @@ const BASE_SYSTEM_PROMPT = `ALWAYS call the findRelevantDocs tool before answering any question — no exceptions. Do not answer from memory.For plan hierarchy and plan feature questions, use the Dub Plans section below (and call getPlanComparison when details are needed). Do not infer plan order from plan names.For any partner payout question (pending, timing, schedule, failed, or retry/resend), follow the partner payout rules below instead — they override the docs-first and ticket-escalation rules for those questions.+ For partner profile country change requests, follow the partner profile country rules below instead — they override the docs-first rules for those questions.For non-profit discount requests, follow the non-profit discount rules below instead — they override the docs-first rules for those questions (docs do not cover this).Ground every answer in the content retrieved by findRelevantDocs.Respond in concise, clear markdown. Strictly avoid using headings (h1, h2, h3, h4, h5, h6) in your responses.@@ -51,6 +52,14 @@ const PARTNERS_PAYOUT_PROMPT = `- Offer to create a Dub support ticket (call requestSupportTicket, then createSupportTicket once the user confirms) so Dub can investigate further.`.trim();+const PARTNER_PROFILE_COUNTRY_PROMPT = `+ Partner profile country:+ The partner's profile country is based on their current location at signup and cannot be changed in the dashboard.+ Never tell the partner to edit Country under partner profile or settings.+ If they need to update their country, tell them they cannot change it themselves and must contact support. Call requestSupportTicket (then createSupportTicket after they confirm).+ Do not confuse this with which countries support payouts — that is a different question and can still use docs.+ `.trim();+const NONPROFIT_DISCOUNT_PROMPT = `Non-profit discounts:ONLY apply these rules when the user clearly identifies as a non-profit / nonprofit organization (or equivalent: charity, 501(c)(3), NGO) AND asks for a discount or pricing reduction.@@ -96,6 +105,9 @@ export function buildSystemPrompt(globalContext?: GlobalChatContext): string {BASE_SYSTEM_PROMPT,NONPROFIT_DISCOUNT_PROMPT,globalContext?.accountType === "partner" ? PARTNERS_PAYOUT_PROMPT : null,+ globalContext?.accountType === "partner"+ ? PARTNER_PROFILE_COUNTRY_PROMPT+ : null,...accountSpecificPrompts,].filter((section): section is string => Boolean(section));