Browse Source

修复更换模型接口后出现的bug

liutao 3 months ago
parent
commit
69163ef435

+ 10 - 3
aiAgent_gd/qwen_agent/config/db_config.py

@@ -3,11 +3,18 @@ db_list = {
     "mysql": {
 
     },
+    # "pg": {
+    #     "host": "10.249.168.231",
+    #     "port": "54321",
+    #     "database": "sde",
+    #     "user": "zjugis",
+    #     "password": "zjugis1402!",
+    # }
     "pg": {
-        "host": "10.249.168.231",
-        "port": "54321",
+        "host": "10.10.9.243",
+        "port": "5432",
         "database": "sde",
-        "user": "zjugis",
+        "user": "sde",
         "password": "zjugis1402!",
     }
 }

+ 2 - 2
aiAgent_gd/qwen_agent/memory/SqlMemory.py

@@ -12,8 +12,8 @@ from qwen_agent.utils.util import get_data_from_jsons
 os.environ["TOKENIZERS_PARALLELISM"] = "false"
 
 embedding_model_dict = {
-    "text2vec": "/data/m3e-base",
-    # "text2vec": "D:\m3e-base",
+    # "text2vec": "/data/m3e-base",
+    "text2vec": "E:\AI_temp\m3e-base",
 
 }
 EMBEDDING_MODEL = "text2vec"  # embedding 模型,对应 embedding_model_dict

+ 2 - 57
aiAgent_gd/qwen_agent/memory/data/plans/plan_examples_土地市场监测.jsonl

@@ -1,62 +1,7 @@
 [
   {
     "query_type": "land_supply",
-    "query": "杭州市2024年至今,住宅、工业、商服用地出让的宗数和面积是多少?",
-    "plan": "Question: 杭州市2024年至今,住宅、工业、商服用地出让的宗数和面积是多少?\nThought: 用户问题中想要查询“杭州市”从“2024年”开始到当前时间节点土地用途为住宅用地、工业用地、商服用地的出让宗数和面积分别是多少,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“杭州市”从“2024年”开始到当前时间节点土地用途为住宅用地、工业用地、商服用地的出让宗数和面积分别是多少\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "杭州市今年主城区、市区、市域土地出让数量分布如何?",
-    "plan": "Question: 杭州市今年主城区、市区、市域土地出让数量分布如何?\nThought: 用户问题中想要查询杭州市今年主城区、市区和市域的土地出让宗数分别是多少,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询杭州市今年主城区、市区和市域的土地出让宗数分别是多少\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "杭州市2024年至今,工业用地出让分区县的情况如何,各区出让宗数和面积是多少?",
-    "plan": "Question: 杭州市2024年至今,工业用地出让分区县的情况如何,各区出让宗数和面积是多少?\nThought: 用户问题中想要查询杭州市从“2024”年开始各区县工业用地的出让数据,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询杭州市从“2024”年开始各区县工业用地的出让数据\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "今年公开出让的建设用地中,涉及物流仓储的有多少宗,多少面积?",
-    "plan": "Question: 今年公开出让的建设用地中,涉及物流仓储的有多少宗,多少面积??\nThought: 用户问题中想要查询“今年” 土地用途二级类里包含 物流 和仓储的土地出让宗数和面积,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“今年” 土地用途二级类里包含 物流 和仓储的土地出让宗数和面积\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "今年出让的工业用地,其中省级以上开发区的面积是多少,集聚度是多少?",
-    "plan": "Question: 今年出让的工业用地,其中省级以上开发区的面积是多少,集聚度是多少?\nThought: 用户问题中想要查询“今年” 土地用途为工业用地的数据中开发区等级为“省级以上”的土地出让面积和其占总出让面积的比例,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“今年” 土地用途为工业用地的数据中开发区等级为“省级以上”的土地出让面积和其占总出让面积的比例\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "杭州市今年出让的工业用地,平均固投是多少,各区县平均固投是多少?",
-    "plan": "Question: 杭州市今年出让的工业用地,平均固投是多少,各区县平均固投是多少?\nThought: 用户问题中想要查询“杭州市”“今年” 土地用途为工业用地 的平均固定投资强度和其各行政区的平均固定投资强度,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“杭州市”“今年” 土地用途为工业用地 的平均固定投资强度和其各行政区的平均固定投资强度\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "近5年浙江省出让的工业用地有多少面积,其中杭州占比多少?",
-    "plan": "Question: 近5年浙江省出让的工业用地有多少面积,其中杭州占比多少?\nThought: 用户问题中想要查询“浙江省”“近五年” 土地用途为工业用地 的出让总面积和其中杭州市的工业用地出让面积及占比,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“浙江省”“近五年” 土地用途为工业用地 的出让总面积和其中杭州市的工业用地出让面积及占比\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "请分析浙江省近几年土地供应总体情况?",
-    "plan": "Question: 请分析浙江省近几年土地供应总体情况?\nThought: 用户问题中想要查询供应地区为“浙江省”年份近5年的供应出让宗数、面积和金额情况,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询供应地区为“浙江省”年份近5年的供应出让宗数、面积和金额情况\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "请分析近几年杭州市工业用地出让情况?",
-    "plan": "Question: 请分析近几年杭州市工业用地出让情况?\nThought: 用户问题中想要查询city为“杭州市”年份为近5年的供应出让面积数据,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询city为“杭州市”年份为近5年的供应出让面积数据\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "请分析浙江省今年土地供应结构?",
-    "plan": "Question: 请分析浙江省今年土地供应结构?\nThought: 用户问题中想要查询供应地区为“浙江省”今年各土地用途的出让面积情况,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询供应地区为“浙江省”今年各土地用途的出让面积情况\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "请分析浙江省2024年各地级市土地供应情况?",
-    "plan": "Question: 请分析浙江省2024年各地级市土地供应情况?\nThought: 用户问题中想要查询供应地区为“浙江省”2024年各地级市的土地出让面积,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询供应地区为“浙江省”2024年各地级市的土地出让面积\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
-  },
-  {
-    "query_type": "land_supply",
-    "query": "请分析近一年浙江省供地同比和环比增长率",
-    "plan": "Question: 请分析近一年浙江省供地同比和环比增长率?\nThought: 用户问题中想要查询“浙江省”的近一年的月供地面积同比和环比增长率,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询今年供应地区为“浙江省”近一年的月供地面积同比和环比增长率\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
+    "query": "2024年的供地中,有多少宗,多少面积?",
+    "plan": "Question: 2024年的供地中,有多少宗,多少面积?\nThought: 用户问题中想要查询“2024年” 所有土地出让宗数和面积,所以需要通过[LandSupplySqlAgent]查询供地信息,最后使用summary的Action来表示供应情况。Plan: ```json\n    [{\"action_name\": \"LandSupplySqlAgent\", \"instruction\": \"你需要调用 [LandSupplySqlAgent],来查询“2024年” 所有土地出让宗数和面积\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和数据库查询的结果,回答用户问题。\"}]"
   }
 ]

+ 2 - 102
aiAgent_gd/qwen_agent/memory/data/sqls/sql_examples_土地市场监测.jsonl

@@ -1,107 +1,7 @@
 [
  {
  "query_type": "land_supply",
- "query": "杭州市2024年至今,住宅、工业、商服用地出让的宗数和面积是多少?",
- "sql_code": "select land_use_type as 土地用途, count(1) as 出让宗数, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') >= '2024' and transaction_sold_time <= current_date and land_use_type in ('住宅用地', '工业用地', '商服用地') group by land_use_type"
- },
- {
- "query_type": "land_supply",
- "query": "杭州市今年各行政区土地出让的数量分布如何?",
- "sql_code": "select county as 行政区, count(1) as 出让数量 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') group by county order by 出让数量 desc  nulls last"
- },
- {
- "query_type": "land_supply",
- "query": "杭州市今年主城区、市区、市域土地出让数量分布如何?",
- "sql_code": "select sum(case when county in ('上城区', '拱墅区', '西湖区', '滨江区') then 1 else 0 end) as 主城区出让宗数,sum(case when county not in ('建德市', '淳安县', '桐庐县') then 1 else 0 end) as 市区区出让宗数, count(1) as 市域出让宗数 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy')"
- },
- {
- "query_type": "land_supply",
- "query": "杭州市2024年至今,工业用地出让分区县的情况如何,各区出让宗数和面积是多少?",
- "sql_code": "select county as 区县, count(1) as 工业用地出让数量 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') >= '2024' group by county order by 工业用地出让数量 desc  nulls last"
- },
- {
- "query_type": "land_supply",
- "query": "今年公开出让的建设用地中,涉及物流仓储的有多少宗,多少面积?",
- "sql_code": "select count(1) as 土地宗数, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 from nrllm.land_supply_combination where to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and land_use_secondary_type similar to '%(物流|仓储)%'"
- },
- {
- "query_type": "land_supply",
- "query": "杭州市今年公开出让的建设用地中,涉及物流仓储的有多少宗,多少面积?",
- "sql_code": "select count(1) as 土地宗数, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and land_use_secondary_type similar to '%(物流|仓储)%'"
- },
- {
- "query_type": "land_supply",
- "query": "今年出让的工业用地,其中省级以上开发区的面积是多少,集聚度是多少?",
- "sql_code": "select round(sum(case when development_zone_level = '省级以上' then land_area_unit_sm else 0 end * 0.0015), 2) as 省级以上开发区总面积, round(sum(case when development_zone_level = '省级以上' then land_area_unit_sm else 0 end * 0.0015) / sum(land_area_unit_sm * 0.0015) ::numeric * 100, 2) as 聚集度 from nrllm.land_supply_combination where to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and land_use_type = '工业用地'"
- },
- {
- "query_type": "land_supply",
- "query": "杭州市今年出让的工业用地,平均固投是多少,各区县平均固投是多少",
- "sql_code": "select '杭州市' as 行政区域, round(avg(investment_intensity_amount / (land_area_unit_sm * 0.0015)), 2) 平均固投 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and land_use_type = '工业用地' and investment_intensity_amount is not null union all select county as 行政区域, round(avg(investment_intensity_amount / (land_area_unit_sm * 0.0015)), 2) 平均固投 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and land_use_type = '工业用地' and investment_intensity_amount is not null group by county"
- },
- {
-  "query": "近5年浙江省出让的工业用地有多少面积,其中杭州占比多少",
-  "query_type": "land_supply",
-  "sql_code": "SELECT round(sum(land_area_unit_sm * 0.0015), 2) AS 浙江省工业用地出让总面积, round(sum((case when city = '杭州市' then land_area_unit_sm else 0 end) )* 0.0015, 2) AS 杭州市工业用地出让总面积, round((sum((case when city = '杭州市' then land_area_unit_sm else 0 end))::numeric / sum(land_area_unit_sm)) * 100, 2) AS 杭州市占比 FROM nrllm.land_supply_combination WHERE to_char(transaction_sold_time, 'yyyy') > to_char(CURRENT_DATE - INTERVAL '5 year', 'YYYY') AND province = '浙江省' AND land_use_type = '工业用地'"
- },
- {
-  "query": "近三年浙江省住宅用地出让面积有多少,其中杭州占比多少",
-  "query_type": "land_supply",
-  "sql_code": "SELECT round(sum(land_area_unit_sm * 0.0015), 2) AS 浙江省住宅用地出让总面积, round(sum((case when city = '杭州市' then land_area_unit_sm else 0 end) )* 0.0015, 2) AS 杭州市住宅用地出让总面积, round((sum((case when city = '杭州市' then land_area_unit_sm else 0 end))::numeric / sum(land_area_unit_sm)) * 100, 2) AS 杭州市占比 FROM nrllm.land_supply_combination WHERE to_char(transaction_sold_time, 'yyyy') > to_char(CURRENT_DATE - INTERVAL '3 year', 'YYYY') AND province = '浙江省' AND land_use_type = '住宅用地'"
- },
- {
-  "query": "近三年,浙江省住宅用地出让金额有多少,其中杭州占比多少",
-  "query_type": "land_supply",
-  "sql_code": "SELECT round(sum(transaction_price), 2) AS 浙江省住宅用地出让金额, round(sum((case when city = '杭州市' then transaction_price else 0 end) ), 2) AS 杭州市住宅用地出让金额, round((sum((case when city = '杭州市' then transaction_price else 0 end))::numeric / sum(transaction_price)) * 100, 2) AS 杭州市占比 FROM nrllm.land_supply_combination WHERE to_char(transaction_sold_time, 'yyyy') > to_char(CURRENT_DATE - INTERVAL '3 year', 'YYYY') AND province = '浙江省' AND land_use_type = '住宅用地'"
- },
- {
- "query_type": "land_supply",
- "query": "近五年浙江省出让的经营性用地有多少出让金,其中杭州占比多少",
- "sql_code": "SELECT SUM(transaction_price) AS 浙江省经营性用地出让总金额, SUM((CASE WHEN city = '杭州市' THEN transaction_price ELSE 0 END)) AS 杭州市经营性用地出让总金额, round((SUM((CASE WHEN city = '杭州市' THEN transaction_price ELSE 0 END))::numeric / SUM(transaction_price)) * 100, 2) AS 杭州市占比 FROM nrllm.land_supply_combination WHERE to_char(transaction_sold_time, 'yyyy') > to_char(CURRENT_DATE - INTERVAL '5 year', 'YYYY') AND province = '浙江省' AND land_use_type IN ('工业用地', '商业用地')"
- },
- {
- "query_type": "land_supply",
- "query": "今年杭州住宅用地出让楼面价是多少,同比去年增长/减少了多少",
- "sql_code": "select to_char(current_date, 'yyyy') as 年份, round(avg(floor_price), 2) as 平均楼面价 from nrllm.land_supply_combination where city = '杭州市' and land_use_type = '住宅用地' and floor_price is not null and to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') union all select to_char(current_date - interval '1 year', 'yyyy') as 年份, round(avg(floor_price), 2) as 平均楼面价 from nrllm.land_supply_combination where city = '杭州市' and land_use_type = '住宅用地' and floor_price is not null and to_char(transaction_sold_time, 'yyyy') = to_char(current_date - interval '1 year', 'yyyy')"
- },
- {
- "query_type": "land_supply",
- "query": "今年杭州出让的住宅用地中,哪个区土地单价最高,最高土地单价为多少",
- "sql_code": "select county as 区县名称, round(transaction_price / land_area_unit_sm::numeric, 2) as 土地单价 from nrllm.land_supply_combination where to_char(transaction_sold_time, 'yyyy') = to_char(current_date, 'yyyy') and city = '杭州市' order by 土地单价 desc nulls last limit 1"
- },
- {
- "query_type": "land_supply",
- "query": "近12个月,杭州出让的住宅用地,每个月的溢价率为多少,溢价率走势如何",
- "sql_code": "select to_char(transaction_sold_time, 'YYYY-MM') as 月份, round(avg(premium_rate), 2) as 平均溢价率 from nrllm.land_supply_combination where to_char(transaction_sold_time, 'YYYY-MM') > to_char(current_date - interval '12 months', 'YYYY-MM') and city = '杭州市' and land_use_type = '住宅用地' group by to_char(transaction_sold_time, 'YYYY-MM') order by 月份  nulls last"
- },
- {
- "query_type": "land_supply",
- "query": "请分析近几年杭州市商业用地出让情况",
- "sql_code": "select to_char(transaction_sold_time, 'yyyy') as 年份, count(1) as 出让宗数, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 from nrllm.land_supply_combination where city = '杭州市' and to_char(transaction_sold_time,'yyyy') > to_char(CURRENT_DATE - INTERVAL '3 year', 'YYYY') and land_use_secondary_type like '%商业用地%' group by to_char(transaction_sold_time, 'yyyy') order by 年份 nulls last"
- },
- {
- "query_type": "land_supply",
- "query": "请分析浙江省各地级市标准地供应情况",
- "sql_code": "SELECT city AS 地级市, COUNT(1) AS 标准地供应宗数, SUM(land_area_unit_sm * 0.0015) AS 标准地总面积 FROM nrllm.land_supply_combination WHERE province = '浙江省' AND is_sample_plot = '是' GROUP BY city ORDER BY 标准地供应宗数 DESC"
- },
- {
- "query_type": "land_supply",
- "query": "请分析浙江省近3年土地供应总体情况",
- "sql_code": "select to_char(transaction_sold_time, 'yyyy') as 年份, count(1) as 出让宗数, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 from nrllm.land_supply_combination where province = '浙江省' and to_char(transaction_sold_time, 'YYYY') > to_char(current_date - interval '3 years', 'YYYY') group by 年份 order by 年份 nulls last"
- },
- {
- "query_type": "land_supply",
- "query": "请分析浙江省今年土地供应结构",
- "sql_code": "SELECT land_use_type as 土地用途, round(sum(land_area_unit_sm * 0.0015), 2) as 出让总面积 FROM nrllm.land_supply_combination WHERE province = '浙江省' AND to_char(transaction_sold_time, 'YYYY') = to_char(CURRENT_DATE, 'YYYY') GROUP BY land_use_type ORDER BY 出让总面积 DESC"
- },
- {
- "query_type": "land_supply",
- "query": "请分析近一年浙江省供地同比和环比增长率",
- "sql_code": "select supply_month, round((land_total_area - pre_month)::numeric * 100 / pre_month, 2) as qoq, round((land_total_area - last_year_month)::numeric * 100 / last_year_month, 2) as yoy from (select supply_month, land_total_area, lag(land_total_area, 1) over (order by supply_month  nulls last ) pre_month, lag(land_total_area, 12) over (order by supply_month  nulls last) last_year_month from (select to_char(transaction_sold_time, 'yyyy-mm') as supply_month, round(sum(land_area_unit_sm) * 0.0015, 0)::int as land_total_area from nrllm.land_supply_combination where to_char(transaction_sold_time, 'yyyy-mm') <= to_char(current_date, 'yyyy-mm') group by supply_month order by supply_month nulls last) t) t order by supply_month desc  nulls last limit 12"
- },
- {
- "query_type": "land_supply",
- "query": "请分析浙江省2022年土地供应情况,包括供应宗数、面积和金额情况",
- "sql_code": "SELECT COUNT(1) AS 供应宗数, SUM(land_area_unit_sm * 0.0015) AS 出让总面积, SUM(transaction_price) AS 出让总金额 FROM nrllm.land_supply_combination WHERE province = '浙江省' AND to_char(transaction_sold_time, 'YYYY') = '2022' GROUP BY province"
+ "query": "2024年的供地中,有多少宗,多少面积?",
+ "sql_code": "SELECT COUNT(1) AS 土地宗数,\n       round(SUM(gdzmj), 2) AS 出让总面积 \nFROM tdgy_xminfo \nWHERE to_char(jdsj, 'yyyy') = '2024';"
  }
 ]

BIN
aiAgent_gd/qwen_agent/sub_agent/__pycache__/summary_agent.cpython-310.pyc


+ 2 - 2
aiAgent_gd/qwen_agent/sub_agent/sql/land_site_selection_sql_agent.py

@@ -49,8 +49,8 @@ class LandSiteSelectionSqlAgent(BaseSubAgent):
         注意2: 查询地区条件时,区县为**时请使用 xzqmc 字段。省为**时请先将行政区名称转换为行政区代码,使用xzqdm字段的前2位进行模糊查询,市为**时请先将行政区名称转换为行政区代码,使用xzqdm字段的前4位进行模糊查询
         注意3: 计算百分比之类的数值时,需要使用round函数保留两位小数
         注意4: 使用 order by 进行排序时。必须使用 nulls last 确保 null值不会对排序产生影响,使用方法如下: order by xxxx desc nulls last 或者 order by xxxx nulls last
-        注意5: 当用户问题中的面积等于不是一个确定值的时候,如‘面积为xx亩左右’或‘面积为xx平方米左右’, 需要条件中添加 abs(area * 0.0015 - xx) <= 5, 将面积差控制在5亩之内,使用 ‘order by abs(area * 0.0015 - xx)  nulls last’ 来进行排序
-        注意5: 当用户问题中的面积是一个确定值的时候,如‘面积为xx亩’或‘面积为xx平方米’, 需要条件中添加 abs(area * 0.0015 - xx) <= 5, 将面积差控制在5亩之内,使用 ‘order by abs(dkmj * 0.0015 - xx)  nulls last’ 来进行排序
+        注意5: 当用户问题中的面积等于不是一个确定值的时候,如‘面积为xx亩左右’或‘面积为xx平方米左右’, 需要条件中添加 abs(dkmj - xx) <= 5, 将面积差控制在5亩之内。使用 ‘order by abs(dkmj - xx)  nulls last’ 来进行排序
+        注意5: 当用户问题中的面积是一个确定值的时候,如‘面积为xx亩’或‘面积为xx平方米’, 需要条件中添加 abs(dkmj - xx) <= 5, 将面积差控制在5亩之内。使用 ‘order by abs(dkmj - xx)  nulls last’ 来进行排序
         注意6: 查询出地块。必须要对dkmj 进行desc排序
         注意7: 问题中设计具体的地点时,需要使用round(st_distance(st_geometryfromtext('具体地点的wkt', 4528), st_transform(shape, 4528))::numeric,0)获取其distance, 如果问题未指定范围则使用 distance <= 5000 来限制在地点5公里内,并对其排序
         注意8: 当问题中提及周边分析的条件时,不需要将其转换为查询条件,比如交通便利,离港口码头近,人口等

+ 0 - 4
aiAgent_gd/qwen_agent/sub_agent/summary_agent.py

@@ -45,8 +45,6 @@ agents_prompt = dict({
           - **行政区**: 
           - **规划用途**: 
           - **用地面积**: 
-          - **用地总价**: 
-          - **综合得分**: 
           - **土地坐落**:
                 
         ### 2.<地块2名称>
@@ -54,8 +52,6 @@ agents_prompt = dict({
           - **行政区**: 
           - **规划用途**: 
           - **用地面积**: 
-          - **用地总价**: 
-          - **综合得分**: 
           - **土地坐落**: 
     
     

+ 2 - 1
aiAgent_gd/run_server_async.py

@@ -31,7 +31,8 @@ llm_turbo_name = "gpt-4-turbo"
 max_ref_token = 4000
 # model_server = "http://10.10.0.10:7907/v1"
 # model_server = "http://lq.lianqiai.cn:7905/v1"
-model_server = "http://10.36.162.54:20331/v1"
+# model_server = "http://10.36.162.54:20331/v1"
+model_server = "http://ac.zjugis.com:8511/v1"
 api_key = ""
 server_host = "0.0.0.0"
 server_port = 8511