zenaight commited on
Commit
f0b5ada
Β·
1 Parent(s): 1a8e9a5

Update WhatsApp formatting guidelines in chat_with_session_memory function

Browse files

- Clarified the use of WhatsApp-specific formatting, emphasizing the correct usage of single asterisks for bold and single underscores for italics, while explicitly stating to avoid markdown formatting.
- Added instructions for strikethrough text and reinforced the importance of concise and well-structured messages for improved user interaction.

Files changed (1) hide show
  1. ai_chat.py +9 -6
ai_chat.py CHANGED
@@ -44,13 +44,15 @@ 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
- "\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":
@@ -117,8 +119,9 @@ def chat_with_session_memory(state):
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
 
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 ONLY WhatsApp formatting (NOT markdown):\n"
48
+ "- *bold text* (single asterisks only, NEVER use **double asterisks**)\n"
49
+ "- _italic text_ (single underscores)\n"
50
+ "- ```monospace text``` (triple backticks)\n"
51
+ "- ~strikethrough text~ (tildes)\n"
52
  "- Use line breaks and spacing for readability\n"
53
  "- Keep messages concise but well-formatted\n"
54
  "- Use emojis sparingly but appropriately (🏠 🏒 πŸ“ πŸ’° πŸ“)\n"
55
+ "- NEVER use markdown formatting like **bold** or __italic__ - only WhatsApp format\n"
56
  )
57
 
58
  if user_info.get("name") and user_info["name"] != "Unknown":
 
119
  f"- When users ask for addresses, provide the Google Maps address from property data\n"
120
  f"- If information isn't available, politely say 'I don't have that information available'\n"
121
  f"- Don't immediately jump to asking about property preferences unless user is actively looking\n"
122
+ f"- Format messages for WhatsApp: use *single asterisks* for bold, NOT **double asterisks**\n"
123
+ f"- Keep property listings well-formatted with clear sections for price, size, location, etc.\n"
124
+ f"- Remember: WhatsApp format (*bold*) is different from Markdown format (**bold**)"
125
  )
126
 
127
  # Build messages array with history