diff --git a/yj_room_agent/LLM/ai_service.py b/yj_room_agent/LLM/ai_service.py index 4a39b7a..2676c26 100644 --- a/yj_room_agent/LLM/ai_service.py +++ b/yj_room_agent/LLM/ai_service.py @@ -185,21 +185,15 @@ def query_avali_room(data: dict, params: dict) -> str: # return json.dumps(result, ensure_ascii=False) new_list = [] # 字典中只要key存在,哪怕对应的value是'',也能取出来空字符串 data.get('capacity', 0)可能是空字符串 - capacity = data.get('capacity', 0) - capacity_limit = int(capacity) if capacity not in [None, ''] else 0 - logger.info("capacity limit {0} {1}".format(capacity_limit, type(capacity_limit))) - if data.get('Region') and data.get('Region') != 'None': - region = data.get('Region') + + if Region and Region != 'None': for b in result: logger.info("b.capacity {0} {1}".format(b.get('capacity', 0), type(b.get('capacity', 0)))) - if ((region in b.get('name', 'default') or region in b.get('typeName', 'default')) and b.get('capacity', - 0) >= capacity_limit): + if (Region in b.get('name', 'default') or Region in b.get('typeName', 'default')): new_list.append(b) return json.dumps(new_list, ensure_ascii=False) else: - for b in result: - if b.get('capacity', 0) >= capacity_limit: - new_list.append(b) + new_list = result return json.dumps(new_list, ensure_ascii=False) except Exception as ex: logger.exception("location: query_avali_room=> {0}".format(str(ex)))