Update python_server/server.py

This commit is contained in:
2025-10-13 14:14:07 +00:00
parent ff54e0ae18
commit ccd89dd57c

View File

@@ -95,8 +95,8 @@ def similarity_search(embedding, top_k=1, threshold=0.7):
return {"status": False, "SKU": None}
best = points[0]
if best.score >= threshold:
print({"status": True, "SKU": best.payload.get("sku")}, "threshold:", best.score)
return {"status": True, "SKU": best.payload.get("sku")}
print({"status": True, "SKU": best.payload.get("product_id")}, "threshold:", best.score)
return {"status": True, "SKU": best.payload.get("product_id")}
print({"status": False, "SKU": None}, "threshold:", best.score)
return {"status": False, "SKU": None}
except Exception as e: