The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
improve prompts
Steven Tey9bf6b83dcf4e
diff --git a/apps/web/app/api/ai/completion/route.ts b/apps/web/app/api/ai/completion/route.tsindex d315ed6ca4..9e7bfeaffe 100644--- a/apps/web/app/api/ai/completion/route.ts+++ b/apps/web/app/api/ai/completion/route.ts@@ -37,7 +37,7 @@ export async function POST(req: NextRequest) {content: prompt,},],- model: "claude-3-sonnet-20240229",+ model: "claude-3-haiku-20240307",stream: true,max_tokens: 300,});diff --git a/apps/web/ui/modals/add-edit-link-modal/index.tsx b/apps/web/ui/modals/add-edit-link-modal/index.tsxindex 693fbacfbc..d33420a15b 100644--- a/apps/web/ui/modals/add-edit-link-modal/index.tsx+++ b/apps/web/ui/modals/add-edit-link-modal/index.tsx@@ -189,7 +189,15 @@ function AddEditLinkModal({const generateAIKey = useCallback(async () => {setKeyError(null);complete(- `You are a helpful assistant and only answer in short link keys, e.g. you receive a question like 'What is the shortlink for meta-title Notion and meta-description The all in one workspace?' and you respond with e.g. 'notion-workspace'. Try to combine them in a shortlink that makes sense and is easy to share on social media. Don't use any special characters or spaces and only response with keys less than 20 characters long. If it makes sense, try to use acronyms/initials, e.g. techcrunch -> tc, github -> gh. Generate a short link for the URL "${data.url}", meta-title "${data.title}" and meta-description "${data.description}"? Please respond with a unique key you haven't used before: ${generatedKeys.join(", ")}`,+ `For the following URL, suggest a relevant short link slug that is at most 12 characters long.++ - URL: ${data.url}+ - Meta title: ${data.title}+ - Meta description: ${data.description}.++ Only respond with the short link slug without quotation marks or special characters.++ Make sure your answer does not exist in this list of generated slugs: ${generatedKeys.join(", ")}`,);}, [data.url, data.title, data.description, generatedKeys]);diff --git a/apps/web/ui/modals/add-edit-link-modal/og-section.tsx b/apps/web/ui/modals/add-edit-link-modal/og-section.tsxindex fa5ea30190..1f978c534b 100644--- a/apps/web/ui/modals/add-edit-link-modal/og-section.tsx+++ b/apps/web/ui/modals/add-edit-link-modal/og-section.tsx@@ -62,7 +62,14 @@ export default function OGSection({const generateTitle = async () => {completeTitle(- `You are an SEO expert that specializes in creating SEO-optimized meta title & description tags. You receive a question like 'What is a suitable, new meta-title for Dub?' and you respond with a plain text answer, no quotes, no special characters, nothing other than the tag that you're generating. Try to keep it short and sweet. Generate an SEO-optimized meta title tag (title only, max 120 characters) – given the current version: ${data.title}`,+ `Generate an SEO-optimized meta title tag (max 120 characters) for the following URL:++ - URL: ${data.url}+ - Meta title: ${data.title}+ - Meta description: ${data.description}.++ Only respond with the title tag without quotation marks or special characters.+ `,);};@@ -96,7 +103,13 @@ export default function OGSection({const generateDescription = async () => {completeDescription(- `You are an SEO expert that specializes in creating SEO-optimized meta title & description tags. You receive a question like 'What is a suitable, new meta-title for Dub?' and you respond with a plain text answer, no quotes, no special characters, nothing other than the tag that you're generating. Try to keep it short and sweet. Generate an SEO-optimized meta description tag (description only, max 240 characters) – given the current version: ${data.description}`,+ `Generate an SEO-optimized meta description tag (max 240 characters) for the following URL:++ - URL: ${data.url}+ - Meta title: ${data.title}+ - Meta description: ${data.description}.++ Only respond with the description tag without quotation marks or special characters.`,);};