From a049df1f18ba990b5f2a7af125a44c221c601761 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 27 Mar 2026 16:42:40 +0800 Subject: [PATCH] bugfix --- wwwroot/product_query_price.dspy | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/wwwroot/product_query_price.dspy b/wwwroot/product_query_price.dspy index 3ff0693..760b1ec 100644 --- a/wwwroot/product_query_price.dspy +++ b/wwwroot/product_query_price.dspy @@ -1,16 +1,29 @@ - +debug(f'{params_kw=}') product_type = params_kw.product_type product_id = params_kw.product_id config_data = params_kw.config_data - +if 'off_peak' in config_data.keys(): + if off_peak in ['Y', '1', 1]: + config_data.off_peak = True + elif off_peak in ['N', '0', 0]: + config_data/off_peak = False +debug(f'{config_data=}') if product_type == 'llm': - r = await llm_query_price(product_id, config_data) - return { - "status": "ok", - "data": { - "prices": r + try: + r = await llm_query_price(product_id, config_data) + return { + "status": "ok", + "data": { + "prices": r + } + } + except Exception as e: + return { + "status": "error", + "data": { + "message": str(e) + } } - } return { "status": "error", "data": {