Generate a Short Chat Title (2-5 Words)

Turns the first user message into a 2-5 word chat title and outputs only the title, with four input-to-title examples and a ban on hashtags, prefixes and quotes.

  • 🤖 Any chat LLM
  • 🗂️ Writing

Last verified: write-up checked

Prompt by Vercel (vercel/chatbot) · Original source (opens in a new tab)

Generate a Short Chat Title (2-5 Words) — prompt preview

The prompt

prompt
Generate a short chat title (2-5 words) summarizing the user's message.

Output ONLY the title text. No prefixes, no formatting.

Examples:
- "what's the weather in nyc" → Weather in NYC
- "help me write an essay about space" → Space Essay Help
- "hi" → New Conversation
- "debug my python code" → Python Debugging

Never output hashtags, prefixes like "Title:", or quotes.

What it is

Turns the first user message into a 2-5 word chat title and outputs only the title, with four input-to-title examples and a ban on hashtags, prefixes and quotes. The examples on this page are copied from the same source file; we did not run them. The prompt text comes from the chatbot repository (Apache License 2.0, Copyright 2024 Vercel, Inc.). Licence: https://github.com/vercel/chatbot/blob/main/LICENSE. Original author: Vercel (vercel/chatbot). Changes by FoxaMind: JavaScript template-literal quotes removed and escaped backticks unescaped; ${...} placeholders keep the source syntax.

Who it's for

  • Developers building chat apps
  • Anyone naming conversations or notes

يحوّل أول رسالة للمستخدم إلى عنوان محادثة من 2 إلى 5 كلمات ويخرج العنوان فقط، مع أربعة أمثلة وحظر الوسوم والبادئات وعلامات الاقتباس.

Examples

Examples inside the prompt

Prompt
prompt
"what's the weather in nyc" -> Weather in NYC
"help me write an essay about space" -> Space Essay Help
"hi" -> New Conversation
"debug my python code" -> Python Debugging

Expected output: The four examples listed in the source prompt (arrows written as -> here). Not re-run by us.

Tips

  • The prompt says to output ONLY the title text, with no prefixes or formatting.
  • The example "hi" maps to "New Conversation" in the source.