From da5e63817fbaba59acbc6da731f6f153ac9b0071 Mon Sep 17 00:00:00 2001 From: Kagamine Rin Date: Sun, 31 May 2026 10:45:00 -0400 Subject: [PATCH] fix: Keep Composing now incorporates user's text instead of replacing it The MAESTRO_COMPLETE_PROMPT was telling Gemini to NOT repeat the user's text, which caused the frontend to replace the entire prompt with only the completion. Changed the prompt to instruct Gemini to rewrite and expand the user's idea into a complete, polished prompt that incorporates their words naturally. This way setPrompt(result) replaces with something the user recognizes as their own idea, expanded. --- backend/src/text_gen.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/src/text_gen.py b/backend/src/text_gen.py index de0f449..b2fbc30 100644 --- a/backend/src/text_gen.py +++ b/backend/src/text_gen.py @@ -127,17 +127,17 @@ Output ONLY the prompt text. No numbers, no labels, no commentary.""" MAESTRO_COMPLETE_PROMPT = """You are Maestro, an expert music prompt writer for AI music generation models (specifically Google Lyria). -The user has started writing a prompt and wants you to complete it. Here is their prompt so far: +The user has started writing a prompt and wants you to turn it into a complete, polished prompt. Here is what they have so far: "{user_input}" -Complete this prompt into a detailed, evocative music generation prompt. Your completion should: -- Build on the user's existing idea naturally -- Add specific details about genre, instrumentation, mood, tempo, structure, or production style -- Result in a single paragraph that's ready to use as-is -- Be between 2-4 sentences total (including what the user already wrote) +Rewrite and expand their idea into a single detailed, evocative music generation prompt. Your result should: +- Incorporate the user's existing words naturally — they should recognize their idea in the result +- Expand with specific details about genre, instrumentation, mood, tempo, structure, or production style +- Read as one complete, cohesive paragraph ready to use as-is +- Be between 2-4 sentences total -Do NOT repeat what the user wrote — continue from where they left off and blend it into a complete, polished prompt. +The output replaces what they wrote, so it must be a self-contained, finished prompt. Output ONLY the completed prompt text. No numbers, no labels, no commentary."""