Spaces:
Running
Running
Upload 9 files
Browse files- prompts/aiVoice.js +14 -0
- prompts/bookRecap.js +40 -0
- prompts/comicTranslator.js +22 -0
- prompts/contentCreator.js +54 -0
- prompts/recap.js +32 -0
- prompts/srttranslator.js +42 -0
- prompts/subtitle.js +29 -0
- prompts/transcription.js +16 -0
- prompts/translation.js +46 -0
prompts/aiVoice.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const AI_VOICE_PROMPT = (tone) => `
|
| 2 |
+
Task: Perform a natural, high-quality human voice-over.
|
| 3 |
+
Selected Tone: ${tone}.
|
| 4 |
+
|
| 5 |
+
PERFORMANCE GUIDELINES:
|
| 6 |
+
1. NATURAL PACING: Do not sound robotic. Use natural breathing spaces and human-like pauses between sentences and clauses.
|
| 7 |
+
2. EMOTIONAL MATCHING:
|
| 8 |
+
- If 'Exciting': High energy, enthusiastic, and faster-paced.
|
| 9 |
+
- If 'Calm': Gentle, soothing, and slow-paced.
|
| 10 |
+
- If 'Professional': Authoritative, clear, and mid-paced.
|
| 11 |
+
- If 'Narrative': Storytelling style, rhythmic, and expressive.
|
| 12 |
+
3. BURMESE CONVERSATIONAL FLOW: Pay close attention to conversational endings (ပါတယ်၊ တာပါ၊ တယ်၊ ဖြစ်ပါတယ်). They must be delivered smoothly as part of a natural speech pattern, not as isolated formal words.
|
| 13 |
+
4. EMPHASIS: Intelligently emphasize key words to convey the true meaning of the script.
|
| 14 |
+
`;
|
prompts/bookRecap.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const BOOK_RECAP_PROMPT = (targetLanguage) => {
|
| 2 |
+
const isBurmese = targetLanguage.toLowerCase().includes('burm') || targetLanguage.includes('မြန်မာ');
|
| 3 |
+
|
| 4 |
+
// Clean language name for the prompt
|
| 5 |
+
const cleanLanguage = targetLanguage.split(' (')[0];
|
| 6 |
+
|
| 7 |
+
// Dynamic Author Persona logic moved from the backend service to here
|
| 8 |
+
const authorPersona = isBurmese
|
| 9 |
+
? `You are a world-class Literary Translator and Novelist. Your task is to translate the provided text into beautiful, natural Burmese.`
|
| 10 |
+
: `You are a professional Book Translator and Author. Provide a complete, high-quality translation of this document into ${cleanLanguage}.`;
|
| 11 |
+
|
| 12 |
+
// Strict Burmese rules used specifically for high-quality literature
|
| 13 |
+
const burmeseRules = isBurmese ? `
|
| 14 |
+
STRICT BURMESE LITERARY RULES:
|
| 15 |
+
- STYLE: Literary and Elegant (Novel-like).
|
| 16 |
+
- TONE: Maintain the author's original emotional depth.
|
| 17 |
+
- PRONOUNS: Use contextually appropriate pronouns (e.g., "ကျွန်တော်", "ကျွန်မ", "သူ") based on character relationships.
|
| 18 |
+
- ENDINGS: Avoid rigid formal markers; use natural literary flow (e.g., 'ပါတယ်', 'ခဲ့ပါတယ်', 'ခဲ့သည်').
|
| 19 |
+
- FLOW: The translation must feel like a professionally published Burmese novel, not a literal translation.
|
| 20 |
+
` : "";
|
| 21 |
+
|
| 22 |
+
return `
|
| 23 |
+
Task: Professional literary translation and analysis into ${cleanLanguage}.
|
| 24 |
+
|
| 25 |
+
AUTHOR PERSONA:
|
| 26 |
+
${authorPersona}
|
| 27 |
+
|
| 28 |
+
STRICT RULE:
|
| 29 |
+
- NO SUMMARIZATION: Translate every single sentence. Do not shorten or skip content.
|
| 30 |
+
- DETAIL PRESERVATION: The output must contain the same level of detail as the original document.
|
| 31 |
+
- OUTPUT FORMAT: Provide ONLY the translated text.
|
| 32 |
+
|
| 33 |
+
${burmeseRules}
|
| 34 |
+
|
| 35 |
+
INSTRUCTIONS:
|
| 36 |
+
- Analyze the narrative style and tone of the source document.
|
| 37 |
+
- Adapt the language to fit the target culture while maintaining the original meaning.
|
| 38 |
+
- Translate the document COMPLETELY (100% length).
|
| 39 |
+
`;
|
| 40 |
+
};
|
prompts/comicTranslator.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const COMIC_TRANSLATOR_PROMPT = (targetLanguage) => {
|
| 2 |
+
const isBurmese = targetLanguage.toLowerCase().includes('burm') || targetLanguage.includes('မြန်မာ');
|
| 3 |
+
|
| 4 |
+
const burmeseRules = isBurmese ? `
|
| 5 |
+
STRICT BURMESE SRT RULES (MANDATORY OUTPUT STYLE):
|
| 6 |
+
- STYLE: Professional Subtitling Style (Native-like).
|
| 7 |
+
- ENDINGS: Strictly NO formal markers like 'သည်', '၏', 'သော'.
|
| 8 |
+
- CONVERSATIONAL ENDINGS: Use only 'ပါတယ်', 'တာပါ', 'တယ်', 'တာပေါ့'.
|
| 9 |
+
- FLOW: The translation must sound like a native Burmese speaker.
|
| 10 |
+
` : "";
|
| 11 |
+
|
| 12 |
+
return `
|
| 13 |
+
TASK: Process this document page by page. For each page, identify all text bubbles.
|
| 14 |
+
Provide their [ymin, xmin, ymax, xmax] coordinates and the translated text in ${targetLanguage}.
|
| 15 |
+
|
| 16 |
+
STRICT RULE:
|
| 17 |
+
- Output ONLY valid JSON.
|
| 18 |
+
- Do not include markdown headers or commentary.
|
| 19 |
+
|
| 20 |
+
${burmeseRules}
|
| 21 |
+
`;
|
| 22 |
+
};
|
prompts/contentCreator.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const CONTENT_CREATOR_PROMPT = (topic, category, subTopics, contentType, gender, targetLang) => {
|
| 2 |
+
const isBurmese = targetLang.toLowerCase() === 'burmese' || targetLang === 'မြန်မာဘာသာ';
|
| 3 |
+
let burmeseRules = "";
|
| 4 |
+
if (isBurmese) {
|
| 5 |
+
const pronoun = gender === 'male' ? "ကျွန်တော် (Kyun-Daw)" : "ကျွန်မ (Kyun-Ma)";
|
| 6 |
+
burmeseRules = `
|
| 7 |
+
STRICT BURMESE NARRATIVE RULES:
|
| 8 |
+
- Output must be a PURE NARRATIVE. NO structural labels, NO titles, NO scene headers.
|
| 9 |
+
- ABSOLUTELY FORBIDDEN tags: 'အပိုင်း', 'နိဒါန်း', 'ရုပ်ပုံဖော်ပြချက်', 'Host:', 'Visual:', 'SCENE', 'Intro', 'Title', 'Idea'.
|
| 10 |
+
- AVOID formal/literary endings: 'သည်', '၏', 'သော'.
|
| 11 |
+
- PRONOUNS: Use '${pronoun}' naturally. DO NOT repeat it excessively as it sounds unnatural. Use it only when necessary to establish identity or connection.
|
| 12 |
+
|
| 13 |
+
DYNAMIC HOOKS & TONE:
|
| 14 |
+
- DO NOT start with a fixed greeting like "Mingalaba" every time.
|
| 15 |
+
- START with a powerful, context-aware HOOK. This could be:
|
| 16 |
+
* A thought-provoking question related to "${topic}".
|
| 17 |
+
* A startling fact or futuristic scenario.
|
| 18 |
+
* An immediate emotional connection or a "What if" situation.
|
| 19 |
+
- TONE MATCHING: The writing style MUST match the category ("${category}") and topic ("${topic}").
|
| 20 |
+
* If it's Motivation/Startup: Use energetic, inspiring, and direct language.
|
| 21 |
+
* If it's Sad/Emotional/Health: Use a calm, empathetic, and gentle tone.
|
| 22 |
+
* If it's Fiction/Horror: Use immersive, mysterious, and descriptive language.
|
| 23 |
+
|
| 24 |
+
CONVERSATIONAL ENDINGS (Mix & Match naturally):
|
| 25 |
+
- Use only polite conversational endings. DO NOT be repetitive. Rotate through these based on context:
|
| 26 |
+
* 'ပါတယ်', 'တာပါ', 'တယ်', 'ဖြစ်ပါတယ်', 'ဖြစ်နေပါတယ်'
|
| 27 |
+
* 'ရှိပါတယ်', 'ရှိနေပါတယ်', 'ရှိနေတာပါ', 'ရှိခဲ့ပါတယ်'
|
| 28 |
+
* 'မရှိခဲ့ပါဘူး', 'မဖြစ်ခဲ့ပါဘူး', 'ဖြစ်မှာမဟုတ်ပါဘူး', 'ဖြစ်မှာပါ'
|
| 29 |
+
* 'လိုက်ပါတယ်', 'တွေ့လိုက်ရပါတယ်', 'လုပ်လိုက်ရပါတယ်'
|
| 30 |
+
* 'ဖြစ်စေခဲ့ပါတယ်', 'ဖြစ်စေခဲ့တာမဟုတ်ပါဘူး'
|
| 31 |
+
* 'လို့ပါ', 'မဟုတ်လို့ပါ', 'ဟုတ်နေလို့ပါ', 'ဖြစ်နေလို့ပါ'
|
| 32 |
+
* 'ပါဘူး', 'ဦးမယ်နော်', 'ခင်ဗျာ', 'ရှင့်'
|
| 33 |
+
|
| 34 |
+
STYLE SPECIFICS:
|
| 35 |
+
- FOR VIDEO: Write as if someone is speaking directly to a camera or audience. Engaging, active, and conversational.
|
| 36 |
+
- FOR TEXT: Write as a smooth, immersive story. Focus on flow and beautiful word choices to keep the reader hooked.
|
| 37 |
+
|
| 38 |
+
- CHECKLIST INTEGRATION: Naturally weave these points into the flow: ${subTopics.join(', ')}.
|
| 39 |
+
`;
|
| 40 |
+
}
|
| 41 |
+
return `
|
| 42 |
+
Task: Write a highly engaging ${contentType} as a continuous conversational narrative about "${topic}".
|
| 43 |
+
Category: ${category}
|
| 44 |
+
Language: ${targetLang}
|
| 45 |
+
|
| 46 |
+
${burmeseRules}
|
| 47 |
+
|
| 48 |
+
Instructions:
|
| 49 |
+
1. The entire output should be ONLY the words to be spoken or read.
|
| 50 |
+
2. No meta-information, no descriptions, no stage directions.
|
| 51 |
+
3. Use clear paragraphs for readability.
|
| 52 |
+
4. Language must be beautiful, smooth, and human-like.
|
| 53 |
+
`;
|
| 54 |
+
};
|
prompts/recap.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const RECAP_PROMPT = (targetLanguage) => {
|
| 2 |
+
const isBurmese = targetLanguage.toLowerCase().includes('burm') || targetLanguage.includes('မြန်မာ');
|
| 3 |
+
const burmeseRules = isBurmese ? `
|
| 4 |
+
STRICT BURMESE CINEMATIC RULES (MANDATORY):
|
| 5 |
+
- ROLE: Professional Narrative Recap Specialist (ဇာတ်ကြောင်းပြန်ကျွမ်းကျင်သူ).
|
| 6 |
+
- PERSPECTIVE: STRICT THIRD-PARTY (တတိယလူအမြင်).
|
| 7 |
+
- PRONOUNS: ABSOLUTELY FORBIDDEN to use "ကျွန်တော်", "ကျွန်မ", "ငါ" (No First Person).
|
| 8 |
+
- IDENTIFIERS: Refer to subjects as "ဒီလူကြီးက", "ဒီအမျိုးသမီးက", "ဒီအစ်ကိုကြီးက", "ဒီမြွေကြီးက", "ဒီသက်ရှိလေးက" to maintain natural storytelling.
|
| 9 |
+
- ENDINGS: Strictly NO 'သည်', '၏', 'သော' (Literary markers).
|
| 10 |
+
- CONVERSATIONAL FLOW: Use only 'ပါတယ်', 'တာပါ', 'တယ်', 'တာပေါ့', 'ဖြစ်နေတာပါ', 'သွားတာပါ', 'လိုက်ပါသေးတယ်', 'နေတာပါပဲ'.
|
| 11 |
+
- DIALOGUE RECONSTRUCTION: Look at the conversation/dialogue in the transcript. Reconstruct the VISUAL scene. Describe actions like "သူက ဒေါသတကြီးနဲ့ အော်ပြောလိုက်ပုံက...", "ဒီနေရာမှာ သူတို့နှစ်ယောက် အပြန်အလှန် ငြင်းခုန်နေကြတာဟာ...".
|
| 12 |
+
` : "";
|
| 13 |
+
return `
|
| 14 |
+
Task: Generate an EXTREMELY DETAILED, LONG-FORM "Cinematic Scene-by-Scene Narrative Recap".
|
| 15 |
+
|
| 16 |
+
WORKFLOW STEPS:
|
| 17 |
+
1. DEEP RESEARCH: Analyze the provided transcript in full. Understand every character's motive, every plot twist, and the emotional arc of the entire content.
|
| 18 |
+
2. CHRONOLOGICAL RECONSTRUCTION: Start from the very first second and walk the reader through the entire content scene-by-scene.
|
| 19 |
+
3. CONTENT WEIGHT: The output length must be roughly 1/4 to 1/3 of the original transcript's duration. For 1 hour of content, the recap should be a 15-25 minute read. DO NOT summarize. BE VERBOSE.
|
| 20 |
+
4. THIRD-PARTY STORYTELLING: Write as if you are a storyteller explaining a movie or a story to an audience. Use an engaging, rhythmic, and immersive tone.
|
| 21 |
+
5. NO SUMMARIZATION TRAPS: Avoid meta-talk like "The video discusses..." or "In conclusion...". Simply tell the story from start to finish.
|
| 22 |
+
|
| 23 |
+
${burmeseRules}
|
| 24 |
+
|
| 25 |
+
FINAL FORMATTING:
|
| 26 |
+
- Output ONLY the narrative text.
|
| 27 |
+
- NO titles, NO headers, NO bullet points.
|
| 28 |
+
- Use multiple long, descriptive paragraphs to separate logical events.
|
| 29 |
+
- Ensure the flow is continuous and feels like reading a professional movie recap script.
|
| 30 |
+
- Focus on the "vibe", humor, and excitement found in the original dialogue.
|
| 31 |
+
`;
|
| 32 |
+
};
|
prompts/srttranslator.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const SRT_TRANSLATOR_PROMPT = (sourceLanguage, targetLanguage) => {
|
| 2 |
+
const isTargetBurmese = targetLanguage.toLowerCase().includes('burm') || targetLanguage.includes('မြန်မာ');
|
| 3 |
+
const burmeseRules = isTargetBurmese ? `
|
| 4 |
+
STRICT BURMESE SRT RULES (MANDATORY OUTPUT STYLE):
|
| 5 |
+
- STYLE: Professional Subtitling Style (Native-like).
|
| 6 |
+
- TONE: Differentiate between Narration and Dialogue based on content.
|
| 7 |
+
- PRONOUNS: Use common conversational terms like "ငါ", "မင်း", "သူ", "ကျွန်တော်", "ရှင်" based on inferred character relationships.
|
| 8 |
+
- ENDINGS: Strictly NO formal markers like 'သည်', '၏', 'သော', '၌'.
|
| 9 |
+
- CONVERSATIONAL ENDINGS: Use only 'ပါတယ်', 'တာပါ', 'တယ်', 'တာပေါ့', 'ဖြစ်နေတာ', 'သွားပြီ', 'လေ', 'နော်', 'ဦးမှာလား', 'လိုက်တာ'.
|
| 10 |
+
- DIALOGUE vs NARRATION:
|
| 11 |
+
* If it's a direct conversation (e.g., "How are you?"): Translate naturally as "နေကောင်းလား" or "ဘယ်လိုလဲ နေကောင်းရဲ့လား".
|
| 12 |
+
* If it's narration: Use an engaging storytelling flow but keep it concise for subtitles.
|
| 13 |
+
- FLOW: The translation must sound like a native Burmese speaker is saying those lines in a movie context. NO literal or "Google Translate" style.
|
| 14 |
+
` : `
|
| 15 |
+
GENERAL RULES FOR ${targetLanguage}:
|
| 16 |
+
- Maintain a natural, cinematic flow.
|
| 17 |
+
- Ensure the translation fits the context of movie subtitles (concise and easy to read).
|
| 18 |
+
- Use conversational phrasing appropriate for the target culture.
|
| 19 |
+
`;
|
| 20 |
+
const sourceContext = sourceLanguage === 'Auto'
|
| 21 |
+
? "Detect the source language of the SRT content automatically."
|
| 22 |
+
: `The source language is ${sourceLanguage}.`;
|
| 23 |
+
return `
|
| 24 |
+
Task: Translate the provided SRT (SubRip) subtitle content into ${targetLanguage}.
|
| 25 |
+
|
| 26 |
+
CONTEXT:
|
| 27 |
+
- ${sourceContext}
|
| 28 |
+
- Target: ${targetLanguage}
|
| 29 |
+
|
| 30 |
+
STRICT TECHNICAL REQUIREMENTS:
|
| 31 |
+
1. PRESERVE TIMESTAMPS: You MUST keep the original timestamps (e.g., 00:00:01,000 --> 00:00:04,000) exactly as they are.
|
| 32 |
+
2. PRESERVE INDEXES: Do not change the sequence numbers.
|
| 33 |
+
3. OUTPUT FORMAT: The output must be a VALID SRT file.
|
| 34 |
+
4. CONTENT ACCURACY: Translate the meaning faithfully but adapt to the natural flow of the target language.
|
| 35 |
+
|
| 36 |
+
${burmeseRules}
|
| 37 |
+
|
| 38 |
+
INSTRUCTIONS:
|
| 39 |
+
- Analyze the scene context. Is it action? A joke? Emotional? Adjust word choice to match the "vibe".
|
| 40 |
+
- Return ONLY the translated SRT text. DO NOT include any labels, notes, or meta-talk.
|
| 41 |
+
`;
|
| 42 |
+
};
|
prompts/subtitle.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const SUBTITLE_PROMPT = (script) => `
|
| 2 |
+
Task: Generate a professional SRT (SubRip Subtitle) file by perfectly aligning the provided script with the audio input.
|
| 3 |
+
|
| 4 |
+
STRICT TECHNICAL RULES (VIOLATION WILL CAUSE SYNC ERROR):
|
| 5 |
+
1. MANDATORY TIMESTAMP FORMAT:
|
| 6 |
+
- Each segment MUST use exactly "HH:MM:SS,mmm" (e.g., 00:01:05,250 --> 00:01:08,100).
|
| 7 |
+
- NEVER omit the hour digits. For a 2-minute video, it MUST be 00:02:..., NOT 02:...
|
| 8 |
+
- Example: 1 minute 5 seconds is 00:01:05,000.
|
| 9 |
+
|
| 10 |
+
2. PRECISION ALIGNMENT (AUDIO-VISUAL SYNC):
|
| 11 |
+
- START TIME: Must mark the exact millisecond the speaker begins the first word of the segment.
|
| 12 |
+
- END TIME: Must mark the exact millisecond the speaker finishes the last word of the segment.
|
| 13 |
+
- AVOID EARLY ENTRY/EXIT: Subtitles must not appear before the sound starts or remain after the sound ends.
|
| 14 |
+
|
| 15 |
+
3. SILENCE & GAP HANDLING:
|
| 16 |
+
- If there is a gap/silence between sentences (e.g., background music or no talking), DO NOT span a single subtitle block over that silence.
|
| 17 |
+
- End the current block when talking stops. Start the next block ONLY when talking resumes.
|
| 18 |
+
- Ensure you skip non-verbal parts correctly to maintain long-term synchronization.
|
| 19 |
+
|
| 20 |
+
4. BATCH INTEGRITY:
|
| 21 |
+
- Do not let the subtitles drift. If the speaker talks faster or slower later in the video, adjust the timestamps to match the actual wave activity, not just a fixed duration.
|
| 22 |
+
|
| 23 |
+
5. TEXT ACCURACY:
|
| 24 |
+
- Use the provided script exactly: "${script}".
|
| 25 |
+
- Break text into readable chunks (max 7-10 words per segment) matching natural speech pauses.
|
| 26 |
+
|
| 27 |
+
6. PURE OUTPUT:
|
| 28 |
+
- Return ONLY the raw SRT content. No labels like "SRT:", no markdown headers, and no AI commentary.
|
| 29 |
+
`;
|
prompts/transcription.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const TRANSCRIPTION_PROMPT = `
|
| 2 |
+
Task: Transcribe the provided audio content with 100% word-for-word accuracy.
|
| 3 |
+
|
| 4 |
+
STRICT PROHIBITIONS (VIOLATION WILL CAUSE ERROR):
|
| 5 |
+
1. NO TIMESTAMPS: Do not include time markers like (0:00) or [00:01].
|
| 6 |
+
2. NO BULLET POINTS: Do not use "-" or "*" or any list formatting.
|
| 7 |
+
3. NO HEADERS/METADATA: Do not include titles, labels like "Script:", "Speaker:", or "Transcript:".
|
| 8 |
+
4. NO AI COMMENTARY: Do not include sections like "*Reviewing for accuracy*", "Here is your text", or any self-talk.
|
| 9 |
+
5. NO SUMMARIZATION: Do not skip filler words or shorten sentences. Capture EVERYTHING.
|
| 10 |
+
|
| 11 |
+
FINAL FORMAT:
|
| 12 |
+
- Output ONLY the raw spoken text.
|
| 13 |
+
- Use natural paragraphs.
|
| 14 |
+
- The result must look like a clean, pure cinematic script.
|
| 15 |
+
- If the content is in Burmese, maintain the conversational style (no သည်၊ ၏၊ သော) if that's how it was spoken.
|
| 16 |
+
`;
|
prompts/translation.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export const TRANSLATION_PROMPT = (targetLanguage, options) => {
|
| 2 |
+
const isBurmese = targetLanguage.toLowerCase() === 'burmese' || targetLanguage === 'မြန်မာဘာသာ';
|
| 3 |
+
const burmeseRules = isBurmese
|
| 4 |
+
? `
|
| 5 |
+
GLOBAL RULE FOR BURMESE:
|
| 6 |
+
- PRE-ANALYSIS: Read and understand the ENTIRE source text first. Do not translate line-by-line. You must identify the subject's gender (Male/Female), size (Large/Small), and nature (Animal/Human/Spirit) from the overall context before starting.
|
| 7 |
+
- NAMES & LOANWORDS (STRICT):
|
| 8 |
+
* Keep personal names (e.g., John, Taylor, David) in English (Latin characters).
|
| 9 |
+
* Keep marketing/technical loanwords (e.g., Premium, AI, Buy, App) in English (Latin characters) exactly as they appear.
|
| 10 |
+
- INTELLIGENT IDENTIFIERS (MANDATORY):
|
| 11 |
+
* Avoid literal labels. "The female" should be translated as "ဒီမြွေမကြီးက" or "ဒီမြွေမလေးက" depending on context, NEVER just a plain "အမ".
|
| 12 |
+
* DO NOT use phrases like "ဒီတိရစ္ဆာန်မလေး" as it sounds unnatural and rude.
|
| 13 |
+
* USE natural and respectful descriptors like "ဒီသက်ရှိလေး", "ဒီအကောင်လေး", or "ဒီသတ္တဝါလေး" when referring to animals.
|
| 14 |
+
* Adjust based on the subject's status: Use "ဒီလူကြီးက", "ဒီလူငယ်က", "ဒီမြွေမကြီးက", "ဒီမြွေမက", "ဒီကြောင်လေးက" to add flavor and natural flow.
|
| 15 |
+
- FLEXIBLE SPECIES NAMING: For specific species names that lack clear Burmese equivalents (e.g., Rattlesnakes, Walrus), use the format: "[English Name] လို့ခေါ်တဲ့ ဒီ[မျိုးစိတ်]တွေဟာ" or "ဒီ [English Name] လို့ခေါ်တဲ့ [မျိုးစိတ်]ကြီးတွေဟာ".
|
| 16 |
+
- NO FORMAL ENDINGS: ABSOLUTELY FORBIDDEN to use formal literary markers like 'သည်', '၏', 'သော'.
|
| 17 |
+
- CONVERSATIONAL FLOW: Use only natural conversational endings like 'ပါတယ်', 'တာပါ', 'တယ်', 'တာပေါ့'.
|
| 18 |
+
- DYNAMIC ROTATION: Intelligently rotate endings to prevent repetition and sound like a professional documentary or cinematic script.
|
| 19 |
+
- ADAPTABILITY: These are guidelines, not static formulas. Adapt the language to fit the specific scene and emotion of the content.
|
| 20 |
+
` : "";
|
| 21 |
+
const deepMeaningRules = options.meaning ? `
|
| 22 |
+
DEEP MEANING ANALYSIS RULES (REQUESTED):
|
| 23 |
+
- Write in the same human-like conversational tone as the translation.
|
| 24 |
+
- Analyze the essence and subtext. Do not just summarize.
|
| 25 |
+
- FOR LONG CONTENT: Extract 3 to 4 key lessons, warnings, or philosophical insights.
|
| 26 |
+
` : "NOT REQUESTED. RETURN NULL.";
|
| 27 |
+
return `
|
| 28 |
+
Task: Professional cinematic translation and analysis to ${targetLanguage}.
|
| 29 |
+
${burmeseRules}
|
| 30 |
+
|
| 31 |
+
STRICT RULE:
|
| 32 |
+
- NO SUMMARIZATION: Translate every single sentence. Do not shorten or skip content.
|
| 33 |
+
- DETAIL PRESERVATION: The output must contain the same level of detail as the original script.
|
| 34 |
+
|
| 35 |
+
INSTRUCTION: You MUST follow the request checklist below. If a feature is NOT requested, you MUST return null for its JSON field.
|
| 36 |
+
|
| 37 |
+
REQUEST CHECKLIST:
|
| 38 |
+
1. Translation Script: REQUESTED (Full context-aware cinematic script. NO SUMMARIZATION).
|
| 39 |
+
2. Deep Meaning Analysis: ${deepMeaningRules}
|
| 40 |
+
3. Viral Title/Thumbnail Hooks: ${options.suggestions ? 'REQUESTED. Provide viral-ready text.' : 'NOT REQUESTED. RETURN NULL.'}
|
| 41 |
+
|
| 42 |
+
FINAL OUTPUT RULES:
|
| 43 |
+
- Provide the output in a structured JSON format.
|
| 44 |
+
- Ensure the Burmese language remains graceful, context-aware, and conversational throughout.
|
| 45 |
+
`;
|
| 46 |
+
};
|