Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1721,6 +1721,7 @@ async def process_incoming_message(from_number: str, msg: dict):
|
|
1721 |
current_menu_options=list(MENU_CONFIG['product_inquiry']['option_descriptions'].values())
|
1722 |
)
|
1723 |
response = generate_veterinary_product_response(exact_match, user_context)
|
|
|
1724 |
send_whatsjet_message(from_number, response)
|
1725 |
return
|
1726 |
|
@@ -2741,6 +2742,7 @@ def ensure_images_dir():
|
|
2741 |
|
2742 |
# New feature: Send product image with caption (product details)
|
2743 |
async def send_product_image_with_caption(from_number: str, product: Dict[str, Any], user_context: Dict[str, Any]):
|
|
|
2744 |
"""
|
2745 |
Send product image (if available) with product details as caption in a single WhatsApp message.
|
2746 |
If image is not available, send only the product details as text.
|
@@ -3465,6 +3467,7 @@ async def handle_voice_message_complete(from_number: str, msg: dict):
|
|
3465 |
|
3466 |
# --- Update send_product_image_with_caption to latest version ---
|
3467 |
async def send_product_image_with_caption(from_number: str, product: Dict[str, Any], user_context: Dict[str, Any]):
|
|
|
3468 |
"""
|
3469 |
Send product image (if available) with product details as caption in a single WhatsApp message.
|
3470 |
If image is not available, send only the product details as text.
|
|
|
1721 |
current_menu_options=list(MENU_CONFIG['product_inquiry']['option_descriptions'].values())
|
1722 |
)
|
1723 |
response = generate_veterinary_product_response(exact_match, user_context)
|
1724 |
+
await send_product_image_with_caption(from_number, exact_match, user_context)
|
1725 |
send_whatsjet_message(from_number, response)
|
1726 |
return
|
1727 |
|
|
|
2742 |
|
2743 |
# New feature: Send product image with caption (product details)
|
2744 |
async def send_product_image_with_caption(from_number: str, product: Dict[str, Any], user_context: Dict[str, Any]):
|
2745 |
+
logger.info(f"[Product] send_product_image_with_caption called for: {product.get('Product Name', '')}")
|
2746 |
"""
|
2747 |
Send product image (if available) with product details as caption in a single WhatsApp message.
|
2748 |
If image is not available, send only the product details as text.
|
|
|
3467 |
|
3468 |
# --- Update send_product_image_with_caption to latest version ---
|
3469 |
async def send_product_image_with_caption(from_number: str, product: Dict[str, Any], user_context: Dict[str, Any]):
|
3470 |
+
logger.info(f"[Product] send_product_image_with_caption called for: {product.get('Product Name', '')}")
|
3471 |
"""
|
3472 |
Send product image (if available) with product details as caption in a single WhatsApp message.
|
3473 |
If image is not available, send only the product details as text.
|