michecosta commited on
Commit
aa45c70
·
verified ·
1 Parent(s): e3b662a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +58 -182
app.py CHANGED
@@ -4,13 +4,8 @@ from groq import Groq
4
  hotel_context=""""
5
  Nome Hotel: HOTEL PALAZZO VITTURI:
6
  Indirizzo: Castello, 5246 - 30122 Venezia (dove “Castello” è il sestiere e 30122 è il CAP ZIP.)
7
- L’indirizzo del nostro sito web è:
8
-
9
- (clienti in lingua inglese) https://palazzovitturi.com?utm_source=website&utm_medium=chatbot&utm_campaign=botV1
10
-
11
- (clienti in lingua italiana) https://palazzovitturi.com/it/?utm_source=website&utm_medium=chatbot&utm_campaign=botV1
12
-
13
- L’indirizzo email dove contattarci è info@hotelpalazzovitturi.com
14
 
15
  La location dell’hotel in google maps è https://maps.app.goo.gl/YPE2EQhovsx5jS7R8
16
 
@@ -81,171 +76,6 @@ Camera Doppia DELUXE con balcone; numero massimo persone: 2; (possibili beds lay
81
  """
82
 
83
  upgrade_instructions = """
84
- UPSELLING MACHINE
85
-
86
- step-by-step instructions for crafting effective upselling offers at Palazzo Vitturi:
87
-
88
- Instructions:
89
-
90
- Role: Act as an upselling engine to help Palazzo Vitturi staff increase profits through upselling techniques. Focus on persuading guests to upgrade from their current room type to a better and more expensive room category.
91
-
92
- Input: You will receive the guest's current reservation details, including their name, room type, and the price difference to upgrade to a superior room category. The upgraded room type will also be specified.
93
-
94
- Crafting the Offer: Using the provided information, create a concise and persuasive upsell offer suitable for email or WhatsApp communication. Clearly highlight the additional amenities and benefits that will be included complimentary with the room upgrade. Ensure it's evident that these extras are only applicable upon upgrading and not part of the current reservation. Prices should be listed in euros (€).
95
-
96
- Adding Bonuses: To make the offer more enticing, consider adding complimentary benefits tailored to the specific upgrade. For example, include a bottle of Prosecco, a fruit basket, or a complimentary aperitif during the stay. Keep in mind that direct bookings often already include a welcome drink, while bookings through intermediaries like Booking.com or Expedia typically do not. Use your discretion when deciding which extras to include.
97
-
98
- Mandatory list of Available Bonuses at the Vitturi (never invent. Always pick the best amenities from this list.)
99
- The offered amenities/items can be chosen singularly or in a combination of them. Consider the upsell price when you choose what and how much you offer as complimentary top up in order to mitigate too expensive costs for the hotel. For example, if the price or number of nights admits and make it logic and even more compelling, be generous ;). If you offer a glass of wine, must be 2 as a courtesy, since generally the rooms are at least for 2 people. Our wines are handpicked by our local experts and are chosen to let you explore the taste of local region or lesser known regions of Italy 🍷:
100
-
101
-
102
- (special from Italy) Bottiglia Vino Cantina "VITIS IN VULTURE": Foragine Rosso (IGT Basilicata Aglianico-Merlot) OR Riseca Bianco (Fiano-Falanghina-Moscato) regular price is normally 25 euro
103
- Calice di Vino (Merlot, Raboso, Cabernet) regular price is normally 3,5 euro
104
- Prosecco Bottiglia 0,75 Millesimato Brut Secco regular price is normally 25 euro
105
- Prosecco Bottiglia 0,75 ROSE' Millesimato 2023 Brut Dry Cantine "Bosco del Merlo" parte del ricavato a progetti contro la violenza sulle donne regular price is normally 25 euro
106
- (special from Italy) Prosecco Extra DRY Cantina "VITIS IN VULTURE" Millesimato Brut Secco ricavato da Uve della Basilicata. regular price is normally 25 euro
107
- Spritz Aperitivo con Aperol, con Cynar oppure con Select Aperitivo internazionale della tradizione veneziana regular price is normally 3,5 euro
108
- Flute Prosecco (Calice) regular price is normally 3,5 euro
109
- Mazzo Rose Rosse: 11 rose rosse (fare attenzione a offrirlo solo in caso di upgrade importanti e costosi tipo in suite deluxe). Un gesto romantico per stupire il partner, ideale per anniversari o occasioni speciali. regular price is normally 50 euro
110
- Mini tagliere con pezzi di Grana Padano DOC o Asiago e Prosciutto Crudo. Un assaggio di prodotti italiani di alta qualità. regular price is normally 4 euro
111
- Dessert omaggio dal nostro bar regular price is normally 2,5 euro
112
- 10% discount on some Tours in Venice
113
-
114
- Language and Copywriting: Begin with an empathetic opening line that aims to capture the guest's attention and stimulate their desire to read further. Tap into their excitement for the upcoming stay. Ensure your writing style does not make guests feel upset or disappointed if they choose not to upgrade. Apply recent neuroscientific models, NLP techniques, and persuasive language to create compelling copy without sounding overly salesy. Consider targeting your message based on one or more of the Big Five Personality Traits, particularly Openness, Conscientiousness, Agreeableness, and Neuroticism. For example, guests with higher levels of neuroticism might prefer upgrades that ensure greater comfort and security, such as premium room assurances or personalized service.
115
- Always sign as Glerida - Reservation and Experience Manager at Palazzo Vitturi (adapt to language spoken by final guest)
116
-
117
- Brand Consistency: Ensure that the offered upgrades and experiences align with Palazzo Vitturi's historical and luxurious brand personality.
118
-
119
- Personalization Based on Language and Culture: If a telephone prefix is provided (e.g., +33 for France), write the offer in the language corresponding to that country. Adapt your messaging to the guest's cultural background based on their country of origin. For example, English may differ for British and American guests, while Spanish may vary for guests from Spain or South America.
120
-
121
- Crafting the moste engaging subject line:
122
- Suppose you are writing for “Sylvie”
123
- Your subject lines must be designed to be compelling, clickable, and not salesy or spammable. It should personalize the message by addressing the guest directly, using emoji to add visual interest and convey a friendly tone, and hint at the exclusive nature of the offer without giving away too many details. The goal is to pique guests' curiosity and encourage them to open the email or to keep on reading the whatsapp message, to learn more about the special opportunity awaiting them at Palazzo Vitturi.
124
-
125
- → examples of subject lines / whatsapp intros:
126
- Sylvie, your Venetian dream awaits! 🇮🇹✨
127
- A special invitation for your upcoming stay, Sylvie 💌
128
- Sylvie, elevate your Palazzo Vitturi experience 🌟
129
- An exclusive idea for you, Sylvie 🔑
130
- Sylvie, unlock the best of Palazzo Vitturi 🗝️
131
- Your Palazzo Vitturi stay just got even better, Sylvie! 😊
132
- Sylvie, a once-in-a-lifetime opportunity at Palazzo Vitturi 🏰
133
- A personalized proposal for your Venetian getaway, Sylvie 🎁
134
- Sylvie, discover the hidden gems of Palazzo Vitturi 💎
135
- An invitation to indulge, Sylvie 🍾🍓
136
-
137
- Staff Training: To help the staff improve their upselling skills, include the applied neuroscientific models and psychographic targeting techniques in square brackets [ ] at the end of each upgrade offer.
138
-
139
- Examples of upsell offers using the requested techniques:
140
-
141
- Example 1:
142
- Subject: Sylvie, elevate your Palazzo Vitturi experience 🌟
143
-
144
- Bonjour Sylvie,
145
- Picture this: you, sipping a café au lait on your private balcony, gazing out at the enchanting Campo Santa Maria Formosa. ☕✨
146
-
147
- As your stay at Palazzo Vitturi approaches, we have an exclusive offer to make your Venetian escape truly unforgettable.
148
- For just €39 more per night, you can upgrade from your Classic Room to a magnificent Deluxe Room with a balcony. Wake up to stunning views of one of Venice's most charming squares and enjoy the extra space and amenities that come with this superior room category.
149
-
150
- To sweeten the deal, we'd like to offer you a complimentary bottle of Prosecco upon arrival, perfect for toasting to your Italian adventure. 🍾 And as a special thank you for being our guest, we'll also treat you to a complimentary aperitif at our bar during your stay. 🍸
151
-
152
- This exclusive offer is available for a limited time.
153
- If you'd like to seize this opportunity, simply let us know, and we'll take care of the rest.
154
-
155
- We can't wait to welcome you to Palazzo Vitturi and ensure your stay is nothing short of extraordinary.
156
- Arrivederci!
157
-
158
- [Neuroscientific Models: Scarcity, Social Proof, Anchoring; Psychographic Targeting: Openness, Extraversion, Conscientiousness]
159
-
160
- Example 2:
161
-
162
- Subject / Whatsapp intro: An invitation to indulge, Sylvie 🍾🍓
163
-
164
- Hey Sylvie,
165
- Imagine this: you, sipping a latte on your private balcony, taking in the stunning view of Campo Santa Maria Formosa. ☕✨
166
-
167
- As your trip to Palazzo Vitturi gets closer, we wanted to reach out with an exclusive offer to make your Venetian getaway even more incredible.
168
-
169
- For just €39 more per night, you can level up from your Classic Room to a fabulous Deluxe Room with a balcony.
170
-
171
- Wake up to breathtaking views of one of Venice's most picturesque squares and enjoy the extra space and perks that come with this premium room category.
172
-
173
- To make it even better, we want to hook you up with a complimentary bottle of Prosecco when you arrive, perfect for celebrating the start of your Italian adventure. 🍾
174
-
175
- And as a special thank you for choosing us, we'll also throw in a complimentary aperitif at our bar during your stay. 🍸
176
-
177
- This exclusive deal won't last long, so if you're ready to take your stay to the next level, just give us a shout, and we'll handle the rest.
178
-
179
- We can't wait to welcome you to Palazzo Vitturi and make sure your stay is nothing short of amazing.
180
-
181
- See you soon!
182
-
183
- [Neuroscientific Models: Scarcity, Social Proof, Anchoring; Psychographic Targeting: Openness, Extraversion, Conscientiousness]
184
- In this American English version, the language has been adapted to be more casual and friendly, using phrases like "hey," "hook you up," and "give us a shout." The offer still maintains the same structure and persuasive techniques, targeting Sylvie's openness to new experiences, extraversion, and conscientiousness while emphasizing the scarcity and value of the upgrade.
185
-
186
-
187
- Example 3:
188
-
189
- Subject / Whatsapp intro: Vieni a scoprire il segreto di Palazzo Vitturi, Sylvie 🍾🍓
190
-
191
-
192
- Cara Sylvie,
193
- Mentre il tuo soggiorno a Venezia si avvicina, vogliamo farti un'offerta che non potrai rifiutare. ✨
194
-
195
- Sappiamo che hai scelto la Camera Classic, ma pensiamo che meriti di vivere un'esperienza ancora più indimenticabile.
196
-
197
- Abbiamo riservato per te l'opportunità di fare un upgrade a una delle nostre splendide Camere Deluxe con balcone, a soli €39 in più a notte.
198
- Queste camere sono tra le più richieste del nostro hotel, e ora puoi essere tra i pochi fortunati a godere di una vista mozzafiato su Campo Santa Maria Formosa, una delle “piazze” più affascinanti di Venezia. 🏰
199
-
200
- Ma le sorprese non finiscono. Se accetti questa offerta, ti accoglieremo con un cesto di frutta fresca al tuo arrivo, perfetto per uno spuntino dopo il viaggio. 🍓🍇
201
-
202
- E per rendere le tue serate ancora più speciali, ti offriamo anche un coupon per un dessert omaggio dal nostro Bar. 🍰
203
-
204
- Non lasciare che questa opportunità ti sfugga. Le nostre Camere Deluxe con balcone sono quasi sempre fully booked, quindi questa è la tua chance per vivere un soggiorno davvero superiore.
205
-
206
- Sei pronta a dire di sì al lusso? 💎
207
- Rispondici e ci occuperemo di tutto noi.
208
-
209
- Il tuo sogno veneziano ti aspetta al Palazzo Vitturi.
210
- A presto!
211
-
212
- [Modelli Neuroscientifici: Scarsità, Reciprocità, Riprova Sociale; Targeting Psicografico: Apertura all'Esperienza, Estroversione, Gradevolezza]
213
-
214
- In questa nuova versione italiana, sono state utilizzate tecniche persuasive come la scarsità (camere quasi sempre fully booked), la reciprocità (cesto di frutta e dessert omaggio) e la riprova sociale (camere tra le più richieste). Le amenities offerte sono state cambiate in un cesto di frutta fresca all'arrivo e un coupon per un dessert omaggio dal Bar dell'hotel (così l’utente scopre che abbiamo un servizio bar..). Il targeting psicografico si concentra sull'apertura all'esperienza, l'estroversione e la gradevolezza di Sylvie, invitandola a dire di sì al lusso e a vivere un soggiorno superiore.
215
-
216
-
217
- Example 4:
218
-
219
-
220
- Another version of the upgrade offer for Sylvie, tailored for British English and incorporating different persuasive techniques and amenities:
221
-
222
- Subject/Whatsapp intro: Sylvie, unlock the best of Palazzo Vitturi 🗝️
223
-
224
-
225
- Dear Sylvie,
226
- As your much-anticipated stay at Palazzo Vitturi in Venice draws near, we couldn't help but notice that you've booked one of our lovely Classic Rooms.
227
-
228
- While we're certain you'll enjoy your stay, we wanted to extend an exclusive invitation to elevate your experience to truly extraordinary heights. 🌟
229
- We'd like to offer you the chance to upgrade to one of our sumptuous Deluxe Rooms with a balcony for a mere €65 more per night.
230
-
231
- These rooms are the crème de la crème of our hotel, offering unparalleled views of the enchanting Campo Santa Maria Formosa, one of Venice's most iconic squares. 🏰
232
-
233
- But that's not all. As a token of our appreciation for your upgrade and to ensure your stay is nothing short of remarkable, we'll also include a complimentary (special from Italy) bottle of wine Prosecco Extra DRY Cantina "VITIS IN VULTURE" Millesimato Brut Secco ricavato da Uve della Basilicata”, handpicked by our local experts. 🍷
234
-
235
- We imagine that you have discerning tastes, and we're confident that our Deluxe Rooms will surpass your expectations. Our previous guests have raved about these rooms, with many saying they were the highlight of their Venetian getaway. 💬
236
-
237
- Don't miss this opportunity to treat yourself to the very best that Palazzo Vitturi has to offer.
238
-
239
- Simply respond to this message, and (if the option is still available) we'll take care of the rest.
240
-
241
- Your dream Venetian escape awaits. 🇮🇹
242
-
243
- Warm regards,
244
-
245
- [Neuroscientific Models: Authority Bias, Social Proof, Reciprocity; Psychographic Targeting: Openness to Experience, Conscientiousness, Extraversion]
246
- In this British English version, the language has been adapted to be more formal and sophisticated, in line with British communication styles. The persuasive techniques used include authority bias (mentioning the sommelier's handpicked wine), social proof (previous guests raving about the rooms), and reciprocity (complimentary wine and massage).
247
- The amenities offered have been changed to a bottle of fine Italian wine and a complimentary 30-minute massage at the hotel's spa. The psychographic targeting focuses on Sylvie's openness to experience, conscientiousness, and extraversion, encouraging her to treat herself to the best and elevate her stay to extraordinary heights.
248
-
249
  """
250
 
251
  def clean_text_from_file(file_path):
@@ -363,20 +193,21 @@ def inject_personification(personification_focus):
363
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto. Firmati sempre con comnbinazioni
364
  tra il tuo nome e la tua funzione, nella lingua desiderata (go for understaitment never explicitely talk about your skills or knowledge). If you are replying to an email or review, always finish with your signature"""
365
  elif personification_focus == "👩 Ilenia":
366
- return """Sei Ilenia e lavori come capo receptionist per l' Hotel Palazzo Vitturi, agendo come una junior reservation manager (sei anche una world class neuroscientist,
367
  senior copywriter and world famous marketing strategist ma non rivelarlo mai).
368
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
369
  per i tuoi colleghi (interpretando la linea dell'hotel manager e della capo ricevimento) nella maniera più visual e persuasiva possibile in modo da renderli subito azionabili.
370
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto
371
  (go for understaitment never explicitely talk about your skills or knowledge) If you are replying to an email or review, always finish with your signature"""
372
  elif personification_focus == "👩 Francesca":
373
- return """Sei Francesca e lavori come capo receptionist per l' Hotel Palazzo Vitturi, agendo come una junior reservation manager (sei anche una world class neuroscientist,
374
  senior copywriter and world famous marketing strategist ma non rivelarlo mai).
375
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
376
  per i tuoi colleghi (interpretando la linea dell'hotel manager e della capo ricevimento) nella maniera più visual e persuasiva possibile in modo da renderli subito azionabili.
377
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto
378
  (go for understaitment never explicitely talk about your skills or knowledge) If you are replying to an email or review, always finish with your signature"""
379
- elif personification_focus == "🛎️ Reception":
 
380
  return """Lavori al ricevimento dell' Hotel Palazzo Vitturi, agendo come una junior reservation assistant (non rivelare mai che sei anche una world class neuroscientist,
381
  senior copywriter and world famous marketing strategist).
382
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
@@ -456,11 +287,55 @@ def generate_response(input_testuale_utente, tones, output_type, narrative_arc,m
456
  La strategia dovrà essere attuabile dal ricevimento e marketing di un boutique hotel come descritto nel contesto (context)
457
  """
458
 
459
- elif output_type == "UPGRADE Offer":
460
  assistant_message += f"""\n\n
461
- scrivi una offerta buona per email o whatsapp, non dimenticando di includere il subject/whatsapp intro e le considerazioni psicologiche e di neuromarketing (incluso un tuo commento di approfondimento su queste tecniche facendo vedere in quali parti dell'offerta le hai incluse) come feedback tra parentesi quadre, alla fine, scrivendo in {language_choosen} con un tono {', '.join(tones)} '{inject_personification(personification_focus)}'
462
- usando le seguenti istruzioni {upgrade_instructions} contestualizzando l'offerta sul nostro hotel che è qui riassunto {hotel_context}
463
- """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
 
465
 
466
 
@@ -471,10 +346,11 @@ def generate_response(input_testuale_utente, tones, output_type, narrative_arc,m
471
  messages.append({"role": "assistant", "content": assistant_message})
472
 
473
  completion = client.chat.completions.create(
474
- model="llama3-70b-8192",
 
475
  messages=messages,
476
  temperature=0.9,
477
- max_tokens=30000,
478
  top_p=1,
479
  stream=True,
480
  stop=None,
@@ -529,7 +405,7 @@ def generate_response(input_testuale_utente, tones, output_type, narrative_arc,m
529
  return output_html, output_textbox_2
530
 
531
  choices = ["📝 Formal", "🎉 Informal", "📏 Long", "📐 Short", "💡 Inspiring", "😄 Ironic"]
532
- output_types = ["REVIEW Reply", "Facebook Post", "Instagram Post", "Linkedin Post","whatsapp", "EMAIL Reply", "NEWSLETTER", "Marketing Strategy", "Coaching", "Hotel Management", "Ideas","UPGRADE Offer"]
533
  narrative_arcs = ["Hero's Journey", "Story Cycle", "Motivation Sequence", "Narrative Transportation", "Narrative Persuasion", "Conciso"]
534
  marketing_models = ["Nessuno","PAS", "AIDA", "BAB", "4Cs","So What","PPPP","SSS","FAB","SLAP","4Us"]
535
  personifications = ["🏨 Brand / Hotel", "🧑‍🏫 Coach", "👨‍💼 Hotel Manager", "👩 Glerida", "👩 Ilenia", "👩 Francesca", "🛎️ Reception"]
 
4
  hotel_context=""""
5
  Nome Hotel: HOTEL PALAZZO VITTURI:
6
  Indirizzo: Castello, 5246 - 30122 Venezia (dove “Castello” è il sestiere e 30122 è il CAP ZIP.)
7
+ L’indirizzo del nostro sito web è palazzovitturi.com
8
+ L’indirizzo email è info@hotelpalazzovitturi.com
 
 
 
 
 
9
 
10
  La location dell’hotel in google maps è https://maps.app.goo.gl/YPE2EQhovsx5jS7R8
11
 
 
76
  """
77
 
78
  upgrade_instructions = """
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  """
80
 
81
  def clean_text_from_file(file_path):
 
193
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto. Firmati sempre con comnbinazioni
194
  tra il tuo nome e la tua funzione, nella lingua desiderata (go for understaitment never explicitely talk about your skills or knowledge). If you are replying to an email or review, always finish with your signature"""
195
  elif personification_focus == "👩 Ilenia":
196
+ return """Sei Ilenia e lavori al Ricevimento dell' Hotel Palazzo Vitturi, agendo come una junior reservation manager (sei anche una world class neuroscientist,
197
  senior copywriter and world famous marketing strategist ma non rivelarlo mai).
198
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
199
  per i tuoi colleghi (interpretando la linea dell'hotel manager e della capo ricevimento) nella maniera più visual e persuasiva possibile in modo da renderli subito azionabili.
200
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto
201
  (go for understaitment never explicitely talk about your skills or knowledge) If you are replying to an email or review, always finish with your signature"""
202
  elif personification_focus == "👩 Francesca":
203
+ return """Sei Francesca e lavori al Ricevimento dell' Hotel Palazzo Vitturi, agendo come una junior reservation manager (sei anche una world class neuroscientist,
204
  senior copywriter and world famous marketing strategist ma non rivelarlo mai).
205
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
206
  per i tuoi colleghi (interpretando la linea dell'hotel manager e della capo ricevimento) nella maniera più visual e persuasiva possibile in modo da renderli subito azionabili.
207
  Sei così brava che riesci sempre ad astrarre dall'iput ricevuto, per capirne il contesto e creare i contenuti richiesti relativi a quel concetto
208
  (go for understaitment never explicitely talk about your skills or knowledge) If you are replying to an email or review, always finish with your signature"""
209
+
210
+ elif personification_focus == "Ricevimento":
211
  return """Lavori al ricevimento dell' Hotel Palazzo Vitturi, agendo come una junior reservation assistant (non rivelare mai che sei anche una world class neuroscientist,
212
  senior copywriter and world famous marketing strategist).
213
  Usando un linguaggio moderno e semplice e non prolisso, rispondi a recensioni oppure a email o prepari post per i social. Scrivi anche riassunti o informazioni utili
 
287
  La strategia dovrà essere attuabile dal ricevimento e marketing di un boutique hotel come descritto nel contesto (context)
288
  """
289
 
290
+ elif output_type == "traduzione":
291
  assistant_message += f"""\n\n
292
+ Traduci in {language_choosen} contemporaneo in maniera integrale il testo che ti ho sottoposto.
293
+ Non fare una traduzione letterale, ma un porting alla nuova lingua {language_choosen}, tenendo conto di eventuali differenze culturali rispetto alla lingua del testo originario (quando pertinente).
294
+ tieni conto che il nuovo testo in {language_choosen} deve "suonare" bene perchè è il testo di un audio guida, quindi scegli il lessico corretto
295
+ e più pertinente tenendo conto della pronuncia. ovviamente non tradurre le espressioni che devono rimanere nella lingua originaria
296
+ (come per esempio i nomi propri, o dei luoghi)
297
+ * Usa un linguaggio agile e facile da ascoltare**: evita di utilizzare un linguaggio troppo formale o complesso che possa risultare difficile da comprendere.
298
+ *Tieni conto della diversa grammatica: la grammatica della lingua {language_choosen} è diversa da quella della lingua del testo originario,
299
+ quindi è importante adattare la struttura delle frasi per renderle più naturali in {language_choosen}.
300
+
301
+ **Modi di dire e idiomi**
302
+
303
+ 4. **Non tradurre letteralmente i modi di dire**: i modi di dire della lingua originaria non sempre hanno un equivalente diretto in {language_choosen}.
304
+ Cerca di ricreare l'idea o il significato originale utilizzando un'espressione equivalente in {language_choosen}.
305
+ 5. **Usa idiomi e espressioni comuni in {language_choosen}**: per rendere la traduzione più naturale e facile da comprendere, utilizza idiomi e espressioni comuni in {language_choosen}.
306
+ 6. **Evita di utilizzare calchi linguistici**: i calchi linguistici possono risultare innaturali e difficili da comprendere. Cerca di utilizzare espressioni originali in {language_choosen}.
307
+
308
+ **Strutture logiche e assonanze**
309
+
310
+ 7. **Mantieni la struttura logica originale**: cerca di mantenere la struttura logica originale del testo , adattandola alla grammatica della lingua {language_choosen}.
311
+ 8. **Crea assonanze e ritmi naturali**: la lingua {language_choosen} ha un ritmo e un'assonanza diversi da quelli della lingua originaria.
312
+ Cerca di creare assonanze e ritmi naturali nella traduzione.
313
+ 9. **Usa parole con un suono naturale**: evita di utilizzare parole che suonino innaturali o strane in {language_choosen}.
314
+
315
+ **Vocabolario e terminologia**
316
+
317
+ 10. **Usa un vocabolario aggiornato e preciso**: utilizza un vocabolario aggiornato e preciso per evitare errori di traduzione.
318
+ 11. **Conosci la terminologia specifica**: se si tratta di un testo tecnico o specialistico, è importante conoscere la terminologia specifica in {language_choosen}.
319
+ 12. **Evita di utilizzare parole obsolete**: evita di utilizzare parole obsolete o desuete che possano risultare innaturali o strane.
320
+
321
+ **Punteggiatura e formattazione**
322
+
323
+ 13. **Usa la punteggiatura dlela lingua {language_choosen}**: la punteggiatura della lingua {language_choosen} è diversa da quella della lingua del testo originario.
324
+ Utilizza la punteggiatura {language_choosen} per rendere la traduzione più naturale.
325
+ 14. **Mantieni la formattazione originale**: cerca di mantenere la formattazione originale del testo originario, adattandola alle esigenze della traduzione.
326
+
327
+ **Verifica e revisione**
328
+
329
+ 15. **Verifica la traduzione prima di scriverla**: verifica la traduzione per assicurarti che sia precisa e naturale.
330
+ 16. **Revisiona la traduzione prima di scriverla**: revisiona la traduzione per assicurarti che sia libera da errori e innaturalità.
331
+
332
+ **Cultura e contesto**
333
+
334
+ 18. **Tieni conto della cultura {language_choosen}**: la cultura {language_choosen} è diversa da quella della cultura del testo originario.
335
+ Tieni conto delle differenze culturali per adattare la traduzione.
336
+ 19. **Conosci il contesto**: conosci il contesto in cui la traduzione sarà utilizzata per adattarla alle esigenze specifiche.
337
+ 20. **Sii sensibile alle differenze culturali**: sii sensibile alle differenze culturali e adatta la traduzione per evitare errori o fraintendimenti.
338
+ """
339
 
340
 
341
 
 
346
  messages.append({"role": "assistant", "content": assistant_message})
347
 
348
  completion = client.chat.completions.create(
349
+ #model="llama-3.1-70b-versatile",
350
+ model="llama3-groq-70b-8192-tool-use-preview",
351
  messages=messages,
352
  temperature=0.9,
353
+ max_tokens=8000,
354
  top_p=1,
355
  stream=True,
356
  stop=None,
 
405
  return output_html, output_textbox_2
406
 
407
  choices = ["📝 Formal", "🎉 Informal", "📏 Long", "📐 Short", "💡 Inspiring", "😄 Ironic"]
408
+ output_types = ["REVIEW Reply", "Facebook Post", "Instagram Post", "Linkedin Post","whatsapp", "EMAIL Reply", "NEWSLETTER", "Marketing Strategy", "Coaching", "Hotel Management", "Ideas"]
409
  narrative_arcs = ["Hero's Journey", "Story Cycle", "Motivation Sequence", "Narrative Transportation", "Narrative Persuasion", "Conciso"]
410
  marketing_models = ["Nessuno","PAS", "AIDA", "BAB", "4Cs","So What","PPPP","SSS","FAB","SLAP","4Us"]
411
  personifications = ["🏨 Brand / Hotel", "🧑‍🏫 Coach", "👨‍💼 Hotel Manager", "👩 Glerida", "👩 Ilenia", "👩 Francesca", "🛎️ Reception"]