JeCabrera commited on
Commit
9456d19
·
verified ·
1 Parent(s): a5ef5cf

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -20
app.py CHANGED
@@ -116,16 +116,18 @@ if not st.session_state.messages:
116
  st.markdown("""
117
  Hola, soy RoboCopy tu asistente especializado en crear Propuestas de Valor Únicas.
118
 
119
- Te ayudo a desarrollar mensajes persuasivos que conectan con tu audiencia y convierten visitantes en clientes. Para crear las mejores propuestas, necesito información sobre:
120
 
121
- - Tu producto o servicio
122
- - Tu audiencia objetivo
123
- - Los problemas que resuelves
124
- - Tus ventajas competitivas
 
 
 
 
125
 
126
- Utilizo diferentes fórmulas como la Tradicional, Anti-tradicional, Contrato Imposible y Reto Ridículo para crear propuestas adaptadas a tu negocio.
127
-
128
- ¿En qué puedo ayudarte hoy?
129
  """)
130
 
131
  # Add system message to chat history
@@ -135,16 +137,18 @@ if not st.session_state.messages:
135
  content="""
136
  Hola, soy RoboCopy tu asistente especializado en crear Propuestas de Valor Únicas.
137
 
138
- Te ayudo a desarrollar mensajes persuasivos que conectan con tu audiencia y convierten visitantes en clientes. Para crear las mejores propuestas, necesito información sobre:
139
-
140
- - Tu producto o servicio
141
- - Tu audiencia objetivo
142
- - Los problemas que resuelves
143
- - Tus ventajas competitivas
144
 
145
- Utilizo diferentes fórmulas como la Tradicional, Anti-tradicional, Contrato Imposible y Reto Ridículo para crear propuestas adaptadas a tu negocio.
 
 
 
 
 
 
 
146
 
147
- ¿En qué puedo ayudarte hoy?
148
  """,
149
  avatar=AI_AVATAR_ICON,
150
  )
@@ -220,7 +224,15 @@ if prompt := st.chat_input('Describe tu producto/servicio y audiencia objetivo..
220
 
221
  You are a UVP (Unique Value Proposition) expert. Analyze (internally only, do not output the analysis) the user's message to identify information about their product/service and target audience.
222
 
223
- If the user is asking for UVPs, create THREE different UVPs using the most appropriate formula from your knowledge. If the user is asking a question about UVPs or marketing, answer it helpfully.
 
 
 
 
 
 
 
 
224
 
225
  When creating UVPs, follow these CRITICAL INSTRUCTIONS:
226
  - Each UVP must be specific and measurable
@@ -230,11 +242,12 @@ if prompt := st.chat_input('Describe tu producto/servicio y audiencia objetivo..
230
  - Maximum 2 lines per UVP
231
 
232
  If creating UVPs, output in this format:
233
- "Basado en tu descripción, aquí tienes tres propuestas de valor únicas (PUVs) para tu [producto/servicio]:
234
 
235
  1. [First UVP]
236
  2. [Second UVP]
237
  3. [Third UVP]
 
238
 
239
  Estas PUVs destacan [principales beneficios]. ¿Hay alguna que te guste más o quieres que ajuste algún aspecto?"
240
 
@@ -268,7 +281,7 @@ if prompt := st.chat_input('Describe tu producto/servicio y audiencia objetivo..
268
  # Simulate stream of chunk
269
  for ch in chunk.text.split(' '):
270
  full_response += ch + ' '
271
- time.sleep(0.1)
272
  # Rewrites with a cursor at end
273
  message_placeholder.write(full_response + '▌')
274
  # Elimina el indicador de escritura
@@ -293,4 +306,4 @@ if prompt := st.chat_input('Describe tu producto/servicio y audiencia objetivo..
293
  joblib.dump(
294
  st.session_state.gemini_history,
295
  f'data/{st.session_state.chat_id}-gemini_messages',
296
- )
 
116
  st.markdown("""
117
  Hola, soy RoboCopy tu asistente especializado en crear Propuestas de Valor Únicas.
118
 
119
+ Para ayudarte a crear PUVs efectivas, necesito conocer:
120
 
121
+ 1. ¿Qué producto o servicio ofreces?
122
+ 2. ¿A quién va dirigido? (describe tu público objetivo)
123
+ 3. ¿Qué fórmula prefieres usar? Puedo ofrecerte:
124
+ - Tradicional: Clara y directa
125
+ - Anti-tradicional: Innovadora y disruptiva
126
+ - Contrato Imposible: Audaz y sorprendente
127
+ - Reto Ridículo: Humorística y relatable
128
+ 4. ¿Cuántos ejemplos de PUVs necesitas?
129
 
130
+ ¿Empezamos con tu producto o servicio?
 
 
131
  """)
132
 
133
  # Add system message to chat history
 
137
  content="""
138
  Hola, soy RoboCopy tu asistente especializado en crear Propuestas de Valor Únicas.
139
 
140
+ Para ayudarte a crear PUVs efectivas, necesito conocer:
 
 
 
 
 
141
 
142
+ 1. ¿Qué producto o servicio ofreces?
143
+ 2. ¿A quién va dirigido? (describe tu público objetivo)
144
+ 3. ¿Qué fórmula prefieres usar? Puedo ofrecerte:
145
+ - Tradicional: Clara y directa
146
+ - Anti-tradicional: Innovadora y disruptiva
147
+ - Contrato Imposible: Audaz y sorprendente
148
+ - Reto Ridículo: Humorística y relatable
149
+ 4. ¿Cuántos ejemplos de PUVs necesitas?
150
 
151
+ ¿Empezamos con tu producto o servicio?
152
  """,
153
  avatar=AI_AVATAR_ICON,
154
  )
 
224
 
225
  You are a UVP (Unique Value Proposition) expert. Analyze (internally only, do not output the analysis) the user's message to identify information about their product/service and target audience.
226
 
227
+ If the user hasn't provided all the necessary information, guide them through the process by asking for:
228
+ 1. What product/service they offer
229
+ 2. Who their target audience is
230
+ 3. Which formula they prefer (Tradicional, Anti-tradicional, Contrato Imposible, Reto Ridículo)
231
+ 4. How many UVP examples they want
232
+
233
+ If the user mentions a specific formula, use that formula from the puv_formulas dictionary. If they don't specify, suggest the most appropriate formula based on their product/service and audience.
234
+
235
+ If the user is asking for UVPs and has provided sufficient information, create the requested number of different UVPs using the specified formula. If the user is asking a question about UVPs or marketing, answer it helpfully.
236
 
237
  When creating UVPs, follow these CRITICAL INSTRUCTIONS:
238
  - Each UVP must be specific and measurable
 
242
  - Maximum 2 lines per UVP
243
 
244
  If creating UVPs, output in this format:
245
+ "Basado en tu descripción, aquí tienes [número] propuestas de valor únicas (PUVs) para tu [producto/servicio] usando la fórmula [nombre de fórmula]:
246
 
247
  1. [First UVP]
248
  2. [Second UVP]
249
  3. [Third UVP]
250
+ ...
251
 
252
  Estas PUVs destacan [principales beneficios]. ¿Hay alguna que te guste más o quieres que ajuste algún aspecto?"
253
 
 
281
  # Simulate stream of chunk
282
  for ch in chunk.text.split(' '):
283
  full_response += ch + ' '
284
+ time.sleep(0.05) # Más rápido
285
  # Rewrites with a cursor at end
286
  message_placeholder.write(full_response + '▌')
287
  # Elimina el indicador de escritura
 
306
  joblib.dump(
307
  st.session_state.gemini_history,
308
  f'data/{st.session_state.chat_id}-gemini_messages',
309
+ )