SamiKoen commited on
Commit
ccc6292
·
verified ·
1 Parent(s): f7cef89

Fiyat kelimeleri skip_words listesine eklendi + debug logları

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -472,7 +472,8 @@ def chatbot_fn(user_message, history, image=None):
472
  product_words = []
473
  skip_words = ['stok', 'stock', 'kaç', 'adet', 'tane', 'var', 'mı', 'mi',
474
  'mevcut', 'mu', 'bulunuyor', 'hangi', 'mağaza', 'nerede',
475
- 'durumu', 'stoklarda', 'stokta', 'için', 've', 'ile', 'toplam', 'toplamda']
 
476
 
477
  for word in user_message.lower().split():
478
  if word not in skip_words:
@@ -516,11 +517,16 @@ def chatbot_fn(user_message, history, image=None):
516
  if word in product_info[0] or word in product_info[2].lower():
517
  # API'den stok alındıysa veya ürün stokta ise bilgileri al
518
  if has_stock_from_api or product_info[1][0] == "stokta":
 
 
 
519
  # Fiyat bilgisi varsa al
520
  if len(product_info[1]) > 1 and product_info[1][1]:
521
  normal_price = f"\\nFiyat: {product_info[1][1]} TL"
 
522
  else:
523
  normal_price = ""
 
524
 
525
  rebate_price = ""
526
  discount_info = ""
 
472
  product_words = []
473
  skip_words = ['stok', 'stock', 'kaç', 'adet', 'tane', 'var', 'mı', 'mi',
474
  'mevcut', 'mu', 'bulunuyor', 'hangi', 'mağaza', 'nerede',
475
+ 'durumu', 'stoklarda', 'stokta', 'için', 've', 'ile', 'toplam', 'toplamda',
476
+ 'fiyat', 'fiyatı', 'ne', 'nedir', 'kadar']
477
 
478
  for word in user_message.lower().split():
479
  if word not in skip_words:
 
517
  if word in product_info[0] or word in product_info[2].lower():
518
  # API'den stok alındıysa veya ürün stokta ise bilgileri al
519
  if has_stock_from_api or product_info[1][0] == "stokta":
520
+ # Debug: hangi ürün bulundu
521
+ print(f"XML'de bulunan ürün: {product_info[2]}")
522
+
523
  # Fiyat bilgisi varsa al
524
  if len(product_info[1]) > 1 and product_info[1][1]:
525
  normal_price = f"\\nFiyat: {product_info[1][1]} TL"
526
+ print(f"Fiyat bulundu: {product_info[1][1]}")
527
  else:
528
  normal_price = ""
529
+ print("Fiyat bilgisi yok")
530
 
531
  rebate_price = ""
532
  discount_info = ""