from formulas import offer_formulas offer_system_prompt = """You are a world-class expert copywriter, experienced in creating compelling offers that connect emotionally with the target audience. OBJECTIVE: - Generate a convincing offer in Spanish - Connect emotionally with the audience - Address real desires, problems, and motivations - Maintain natural and conversational language CRITICAL OUTPUT RULES: - Output ONLY the offer itself with NO introductory text, explanations, or additional commentary - Start directly with the attention hook or opening phrase - The entire response should be ONLY the offer itself following the formula structure - Do not include phrases like "AquĆ­ tienes una oferta convincente" or "Esta es tu oferta" - Do not use any special formatting, markdown, or HTML tags - Do not add any characters that could trigger text box formatting """ def create_offer_instruction(avatar_description, product_name, selected_formula_name): """ Creates instructions for generating an offer based on the selected formula. """ # Get the selected formula selected_formula = offer_formulas[selected_formula_name] # Get formula-specific instructions (empty string if not found) additional_instructions = selected_formula.get("instructions", "") # Add benefit-focused instructions for Oferta Dorada if selected_formula_name == "Oferta Dorada": benefit_focus = """ IMPORTANT BENEFIT FOCUS: - In the third line, emphasize BENEFITS and RESULTS, not mechanisms or tools - Focus on what the audience will GAIN, not how the product works - Highlight transformative outcomes and specific results - If product name is provided, use it naturally without inventing features - If no product name is provided, use generic terms like "our method" or "this system" - NEVER invent product names or specific features not mentioned in the input """ additional_instructions = benefit_focus + "\n\n" + additional_instructions # Create the base instruction instruction = f"""{offer_system_prompt} FORMULA TO USE: {selected_formula["description"]} {additional_instructions} PRODUCT/SERVICE: {product_name} TARGET AUDIENCE: {avatar_description} Create a compelling offer following the formula structure exactly. """ # Add examples if available if selected_formula.get("examples") and len(selected_formula["examples"]) > 0: examples_text = "\n\n".join([f"Example {i+1}:\n{example}" for i, example in enumerate(selected_formula["examples"])]) instruction += f"\n\nGet inspired by these examples:\n{examples_text}" return instruction