From 731370a659d2f4df8b00a39213522e6fa149278d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 27 Mar 2026 16:55:33 +0800 Subject: [PATCH] bugfix --- wwwroot/product_query_price.dspy | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/wwwroot/product_query_price.dspy b/wwwroot/product_query_price.dspy index 459f1fa..1b02d49 100644 --- a/wwwroot/product_query_price.dspy +++ b/wwwroot/product_query_price.dspy @@ -12,11 +12,19 @@ if 'off_peak' in keys: debug(f'{config_data=}') if product_type == 'llm': try: - r = await llm_query_price(product_id, config_data) + recs = await llm_query_price(product_id, config_data) + amount = 0 + original_amount = 0 + for r in recs: + amount += r.amount + if r.original_amount: + original_amount += r.original_amount + return { "status": "ok", "data": { - "prices": r + "amount": amount, + "original_amoutn": None if original_amount == 0 else original_amount } } except Exception as e: