Spaces:
Sleeping
Sleeping
Update app.py
Browse files15 unmodified lines1617181920212236 unmodified lines5960616263646566676869707172737475767778798014 unmodified lines95969798991001013 unmodified lines105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141130 unmodified lines27227327427527627717 unmodified lines29529629729829930030120 unmodified lines32232332432515 unmodified linesgenai.configure(api_key=os.getenv("GOOGLE_API_KEY"))# Función para obtener la respuesta del modelo Geminidef get_gemini_response(product_service, target_audience, main_benefit, tone_of_voice, temperature, file_content="", image_parts=None):# Check if we have at least one source of informationhas_file_content = bool(file_content.strip())has_image = image_parts is not None36 unmodified linesBUSINESS INFORMATION:{business_info}{reference_info}A Creative Idea is a set of pieces created to sell a brand, product, or service, united by the same idea that is transmitted through a creative concept.First, analyze (but don't output) these points:1. TARGET AUDIENCE ANALYSIS:- What everyday concepts are they familiar with?- What TV shows, movies, or cultural references resonate with them?- What emotions and experiences are meaningful to them?- What mental images would be easy for them to recall?2. PRODUCT/SERVICE ANALYSIS:- What is the main benefit or promise?- What makes it unique or different?- What transformation does it offer?- What process or journey does the customer go through?Based on your internal analysis, create THREE different Creative Concepts in Spanish language.Each concept should be a DIRECT ANALOGY or METAPHOR that connects your product/service to something completely different but familiar.14 unmodified lines- Avoid technical jargon, complex words, or business terminology- Write as if you're explaining to a friend in a casual conversation- Use everyday objects, activities, movies, TV shows or cultural references everyone knows- Make the connection surprising but logical once explained- Focus on the main benefit- Create clear mental images- Be easy to remember3 unmodified linesOutput EXACTLY in this format (no additional text) in Spanish language:CONCEPTO CREATIVO 1:Concepto:[Main message/benefit in simple, conversational language]Creatividad:[Direct analogy using everyday language: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]CONCEPTO CREATIVO 2:Concepto:[Main message/benefit]Creatividad:[Direct analogy: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]CONCEPTO CREATIVO 3:Concepto:[Main message/benefit]Creatividad:[Direct analogy: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]"""130 unmodified linesst.error(f"Error al procesar la imagen: {str(e)}")is_image = Falsetemperature = st.slider("Nivel de creatividad:",min_value=0.0,17 unmodified linestone_of_voice,temperature,file_content,image_parts)# Display the response if it exists in session state20 unmodified linesdata=download_content,file_name=f"conceptos_creativos_{timestamp}.txt",mime="text/plain")15 unmodified lines161718192021222336 unmodified lines6061626364656667686970717273747576777879808114 unmodified lines969798991001011021031043 unmodified lines108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144130 unmodified lines27527627727827928028128228328428528628728828929017 unmodified lines30830931031131231331431531620 unmodified lines33733833934034134234334434534634734834935035135235335435535635735835936036136236315 unmodified linesgenai.configure(api_key=os.getenv("GOOGLE_API_KEY"))# Función para obtener la respuesta del modelo Geminidef get_gemini_response(product_service, target_audience, main_benefit, tone_of_voice, temperature,file_content="", image_parts=None, creative_approach="", contrast_level=3):# Check if we have at least one source of informationhas_file_content = bool(file_content.strip())has_image = image_parts is not None36 unmodified linesBUSINESS INFORMATION:{business_info}{reference_info}A Creative Idea is a set of pieces created to sell a brand, product, or service, united by the same idea that is transmitted through a creative concept.First, analyze (but don't output) these points:1. TARGET AUDIENCE ANALYSIS:- What everyday concepts are they familiar with?- What TV shows, movies, or cultural references resonate with them?- What emotions and experiences are meaningful to them?- What mental images would be easy for them to recall?2. PRODUCT/SERVICE ANALYSIS:- What is the main benefit or promise?- What makes it unique or different?- What transformation does it offer?- What process or journey does the customer go through?Based on your internal analysis, create THREE different Creative Concepts in Spanish language.Each concept should be a DIRECT ANALOGY or METAPHOR that connects your product/service to something completely different but familiar.14 unmodified lines- Avoid technical jargon, complex words, or business terminology- Write as if you're explaining to a friend in a casual conversation- Use everyday objects, activities, movies, TV shows or cultural references everyone knows- Make the connection SURPRISING and UNEXPECTED - connect things that normally wouldn't be connected- Challenge conventional thinking by finding parallels between your product and something completely different- Create analogies that make people say "I never thought of it that way!"- Focus on the main benefit- Create clear mental images- Be easy to remember3 unmodified linesOutput EXACTLY in this format (no additional text) in Spanish language:CONCEPTO CREATIVO 1:Concepto:[Main message/benefit in simple, conversational language]Creatividad:[Direct analogy using everyday language: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]CONCEPTO CREATIVO 2:Concepto:[Main message/benefit]Creatividad:[Direct analogy: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]CONCEPTO CREATIVO 3:Concepto:[Main message/benefit]Creatividad:[Direct analogy: "X es como Y porque Z"]Ejemplo de Titular:[Short headline example applying the creative concept]"""130 unmodified linesst.error(f"Error al procesar la imagen: {str(e)}")is_image = False# Add contrast parametercontrast_level = st.slider("Nivel de contraste:",min_value=1,max_value=5,value=3,step=1,help="Valores más altos generan analogías entre conceptos más distantes y sorprendentes.")temperature = st.slider("Nivel de creatividad:",min_value=0.0,17 unmodified linestone_of_voice,temperature,file_content,image_parts,st.session_state.get("selected_approach", ""),contrast_level if 'contrast_level' in locals() else 3)# Display the response if it exists in session state20 unmodified linesdata=download_content,file_name=f"conceptos_creativos_{timestamp}.txt",mime="text/plain")with st.expander("Opciones avanzadas"):# Add creative approach selectorcreative_approaches = {"Analogías Cotidianas": "Usa objetos y situaciones del día a día para explicar tu producto","Contrastes Extremos": "Compara tu producto con algo completamente opuesto para destacar beneficios","Mundos Ficticios": "Usa referencias de películas, series o libros populares","Absurdo Lógico": "Crea conexiones inesperadas pero que tienen sentido al explicarlas","Inversión de Roles": "Presenta tu producto como si fuera el cliente, o el problema como la solución"}selected_approach = st.selectbox("Enfoque creativo:",options=list(creative_approaches.keys()),index=0,key="approach_selectbox")# Display the description of the selected approachst.info(creative_approaches[selected_approach])# Store the selected approachst.session_state.selected_approach = selected_approach
app.py+59-21