zenaight commited on
Commit ·
1a8e9a5
1
Parent(s): 4a4adb5
whatsapp formats
Browse files- ai_chat.py +10 -1
ai_chat.py
CHANGED
|
@@ -44,6 +44,13 @@ def chat_with_session_memory(state):
|
|
| 44 |
"You may only reference listings passed in state['properties']. "
|
| 45 |
"If the user requests more detail, respond with whatever is in that listing dict (URL, images, features, etc.). "
|
| 46 |
"Always base property recommendations solely on listings in our database."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
if user_info.get("name") and user_info["name"] != "Unknown":
|
|
@@ -109,7 +116,9 @@ def chat_with_session_memory(state):
|
|
| 109 |
f"- When users ask for images, let them know images will be sent separately\n"
|
| 110 |
f"- When users ask for addresses, provide the Google Maps address from property data\n"
|
| 111 |
f"- If information isn't available, politely say 'I don't have that information available'\n"
|
| 112 |
-
f"- Don't immediately jump to asking about property preferences unless user is actively looking"
|
|
|
|
|
|
|
| 113 |
)
|
| 114 |
|
| 115 |
# Build messages array with history
|
|
|
|
| 44 |
"You may only reference listings passed in state['properties']. "
|
| 45 |
"If the user requests more detail, respond with whatever is in that listing dict (URL, images, features, etc.). "
|
| 46 |
"Always base property recommendations solely on listings in our database."
|
| 47 |
+
"\n\nIMPORTANT: You are sending messages via WhatsApp. Use WhatsApp formatting:\n"
|
| 48 |
+
"- *bold text* for emphasis (property names, prices, important details)\n"
|
| 49 |
+
"- _italic text_ for subtle emphasis\n"
|
| 50 |
+
"- ```monospace text``` for addresses or technical details\n"
|
| 51 |
+
"- Use line breaks and spacing for readability\n"
|
| 52 |
+
"- Keep messages concise but well-formatted\n"
|
| 53 |
+
"- Use emojis sparingly but appropriately (🏠 🏢 📍 💰 📏)\n"
|
| 54 |
)
|
| 55 |
|
| 56 |
if user_info.get("name") and user_info["name"] != "Unknown":
|
|
|
|
| 116 |
f"- When users ask for images, let them know images will be sent separately\n"
|
| 117 |
f"- When users ask for addresses, provide the Google Maps address from property data\n"
|
| 118 |
f"- If information isn't available, politely say 'I don't have that information available'\n"
|
| 119 |
+
f"- Don't immediately jump to asking about property preferences unless user is actively looking\n"
|
| 120 |
+
f"- Format messages for WhatsApp: use *bold* for important details, proper spacing, and relevant emojis\n"
|
| 121 |
+
f"- Keep property listings well-formatted with clear sections for price, size, location, etc."
|
| 122 |
)
|
| 123 |
|
| 124 |
# Build messages array with history
|