From 57f9c334bd7042c4d081343cbe5eca58e790758f Mon Sep 17 00:00:00 2001 From: Mark Johnson Date: Thu, 5 Feb 2026 18:06:38 -0500 Subject: [PATCH] Improve playlist-title prompt variety MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR updates the playlist title prompt used by AudioMuse. The previous prompt often produced repetitive titles that tended towards similar words and patterns (for example “neon”, “reverie”, “drive”). The new prompt keeps the existing constraints (ASCII-only, single output, length bounds), but adds clearer guidance around originality and vibe, plus explicit “avoid trite phrasing” examples. In practice, this results in noticeably more varied, fun, and distinctive playlist names. This prompt was tested with OpenAI gpt-5.2. --- ai.py | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/ai.py b/ai.py index 7701deeb..00a87bcb 100644 --- a/ai.py +++ b/ai.py @@ -13,18 +13,23 @@ logger = logging.getLogger(__name__) # creative_prompt_template is imported in tasks.py, so it should be defined here -creative_prompt_template = ( - "You are an expert music collector and MUST give a title to this playlist.\n" - "The title MUST represent the mood and the activity of when you are listening to the playlist.\n" - "The title MUST use ONLY standard ASCII (a-z, A-Z, 0-9, spaces, and - & ' ! . , ? ( ) [ ]).\n" - "The title MUST be within the range of 5 to 40 characters long.\n" - "No special fonts or emojis.\n" - "* BAD EXAMPLES: 'Ambient Electronic Space - Electric Soundscapes - Emotional Waves' (Too long/descriptive)\n" - "* BAD EXAMPLES: 'Blues Rock Fast Tracks' (Too direct/literal, not evocative enough)\n" - "* BAD EXAMPLES: '𝑯𝒘𝒆 𝒂𝒓𝒐𝒏𝒊 𝒅𝒆𝒕𝒔' (Non-standard characters)\n\n" - "CRITICAL: Your response MUST be ONLY the single playlist name. No explanations, no 'Playlist Name:', no numbering, no extra text or formatting whatsoever.\n\n" - "This is the playlist:\n{song_list_sample}\n\n" # {song_list_sample} will contain the full list - +playlist_title_prompt_template = ( + "You are an expert music curator. Your task is to craft a title for a playlist.\n\n" + "To craft a strong title ensure that you:\n" + " - Represent the genres, scenes, and styles of the songs.\n" + " - Capture the overall vibe of the playlist.\n" + " - Reference activities and/or locations that are well suited for listening.\n" + " - Stand out in a sea of boring and trite playlist titles.\n" + " - Be both pithy *and* coherent.\n\n" + "Additionally, you MUST strictly adhere to these rules:\n" + " - Use ONLY standard ASCII characters (a-z, A-Z, 0-9, spaces, and - & ' ! . , ? ( ) [ ]).\n" + " - Keep the length between 10 and 40 characters.\n" + " - Do NOT use special fonts or emojis.\n" + " - Respond with ONLY a single playlist name.\n\n" + "On the topic of creativity...\n" + "Here are some examples of words and phrases that are trite, boring, and uncreative: neon, autumn, quiet, porch, groove, midnight, dusk, night, morning. If you find yourself reaching those words (or other similarly yawn-inducing phrasing), it's a clear sign you need to be more creative. Think laterally!\n\n" + "This is the playlist:\n{song_list_sample}\n\n" + "To begin, think hard and come up with 5-10 options. Explore what works and try different approaches before deciding on the final name for the playlist.\n" ) def clean_playlist_name(name):