From 16bd6423e2994a59ae92068a3a5e51bd8ca44e83 Mon Sep 17 00:00:00 2001 From: yujj128 Date: Mon, 4 Aug 2025 14:11:33 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=8D=A2=E4=B8=BA=E4=BA=BA=E5=B7=A5?= =?UTF-8?q?=E8=BF=87=E6=BB=A4meetingRoomName=E5=92=8CmeetingRoomTypeName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yj_room_agent/LLM/ai_service.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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)))