Browse Source

智能选址提示词

liutao 3 months ago
parent
commit
a37df2c969

+ 4 - 4
aiAgent_gd/qwen_agent/memory/data/plans/plan_examples_智能选址.jsonl

@@ -2,7 +2,7 @@
   {
     "query_type": "land_site_selection",
     "query": "帮我在萧山区推荐几块50亩左右的工业用地",
-    "plan": "Question: 帮我在萧山区推荐一宗50亩左右的工业用地 \nThought: 用户问题中想查询城市为‘萧山区’,面积为‘50’亩左右,土地用途为‘工业用地’的地块,工业用地属于土地用途大类,包含如下具体的土地用途小类'工业用地','通用仓储类','标准厂房','工业用地(新业态用地M0)','工矿仓储用地','其他工业用地',所以需要通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [{\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询城市为‘萧山区’,面积为‘50’亩左右,土地用途为'工业用地','通用仓储类','标准厂房','工业用地(新业态用地M0)','工矿仓储用地','其他工业用地'的地块\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
+    "plan": "Question: 帮我在萧山区推荐几块50亩左右的工业用地 \nThought: 用户问题中想查询城市为‘萧山区’,面积为‘50’亩左右,土地用途为‘工业用地’的地块,数量未限制,工业用地属于土地用途大类,包含如下具体的土地用途小类'工业用地','通用仓储类','标准厂房','工业用地(新业态用地M0)','工矿仓储用地','其他工业用地',所以需要通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [{\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询城市为‘萧山区’,面积为‘50’亩左右,土地用途为'工业用地','通用仓储类','标准厂房','工业用地(新业态用地M0)','工矿仓储用地','其他工业用地'的地块\"},\n    {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
   },
   {
     "query_type": "land_site_selection",
@@ -11,12 +11,12 @@
   },
   {
     "query_type": "land_site_selection",
-    "query": "帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房",
-    "plan": "Question: 帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房 \nThought: 用户问题中想查询城市为‘杭州市’,区县为‘滨江区’,详细地点为‘杭州市滨江区正泰大厦’,数量为‘1’宗,面积为‘50’亩左右,土地用途为‘标准厂房’的地块,所以需要先通过[GisGeocoderAgent]将详细的地址转换为坐标点,再通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [{\"action_name\": \"GisGeocoderAgent\", \"instruction\": \"你需要调用 [GisGeocoderAgent],来将‘杭州市滨江区正泰大厦’ 转换为坐标wkt\"},\n {\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询行政区为‘滨江区’,面积为‘50’亩左右,土地用途为‘标准厂房’的地块\"},   {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
+    "query": "帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房",
+    "plan": "Question: 帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房 \nThought: 用户问题中想查询城市为‘杭州市’,区县为‘滨江区’,详细地点为‘杭州市滨江区正泰大厦’,数量为‘2’宗,面积为‘50’亩左右,土地用途为‘标准厂房’的地块,所以需要先通过[GisGeocoderAgent]将详细的地址转换为坐标点,再通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [{\"action_name\": \"GisGeocoderAgent\", \"instruction\": \"你需要调用 [GisGeocoderAgent],来将‘杭州市滨江区正泰大厦’ 转换为坐标wkt\"},\n {\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询行政区为‘滨江区’,面积为‘50’亩左右,数量为‘2’宗,土地用途为‘标准厂房’的地块\"},   {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
   },
   {
     "query_type": "land_site_selection",
     "query": "请在萧山机场附近选出30-100亩之间适用来做物流仓储的地块",
-    "plan": "Question: 请在萧山机场附近选出30-100亩之间适用来做物流仓储的地块 \nThought: 用户问题中想查询详细地点为‘萧山机场’,面积为‘30-100’亩左右,土地用途为‘物流仓储’的地块,再通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [\n {\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询行政区为‘萧山区’,面积为‘30-100’亩左右,土地用途为‘物流仓储’的地块\"},   {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
+    "plan": "Question: 请在萧山机场附近选出30-100亩之间适用来做物流仓储的地块 \nThought: 用户问题中想查询详细地点为‘萧山机场’,面积为‘30-100’亩左右,土地用途为‘物流仓储’的地块,数量未限制,再通过[LandSiteSelectionSqlAgent]查询图层信息,最后使用summary的Action来总结并输出。Plan: ```json\n    [\n {\"action_name\": \"LandSiteSelectionSqlAgent\", \"instruction\": \"你需要调用 [LandSiteSelectionSqlAgent],来查询行政区为‘萧山区’,面积为‘30-100’亩左右,土地用途为‘物流仓储’的地块\"},   {\"action_name\": \"summary\", \"instruction\": \"你需要根据用户的Question和查询的结果,回答用户问题。\"}]"
   }
 ]

+ 2 - 2
aiAgent_gd/qwen_agent/memory/data/sqls/sql_examples_智能选址.jsonl

@@ -11,8 +11,8 @@
   },
   {
     "query_type": "land_site_selection",
-    "query": "帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房",
-    "sql_code": "select t.* from (select id, dkid, xzqmc, dkmc, address, dkmj, tdyt, round(st_distance(st_geometryfromtext('POINT (120.42827489304307 30.23751646603668)', 4490)::geography,shape::geography)::numeric,0) as distance, st_astext(st_centroid(shape)) as center_wkt from sde.ecgap_klyzy where tdyt ='工业用地' and sfsj=1 and dkmj BETWEEN 30 and 100) as t where t.distance <= 5000  order by t.dkmj nulls last limit 1"
+    "query": "帮我在杭州市滨江区正泰大厦附近推荐宗50亩左右的标准厂房",
+    "sql_code": "select t.* from (select id, dkid, xzqmc, dkmc, address, dkmj, tdyt, round(st_distance(st_geometryfromtext('POINT (120.42827489304307 30.23751646603668)', 4490)::geography,shape::geography)::numeric,0) as distance, st_astext(st_centroid(shape)) as center_wkt from sde.ecgap_klyzy where tdyt ='工业用地' and sfsj=1 and dkmj BETWEEN 30 and 100) as t where t.distance <= 5000  order by t.dkmj nulls last limit 2"
   },
   {
     "query_type": "land_site_selection",

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

@@ -53,7 +53,7 @@ class LandSiteSelectionSqlAgent(BaseSubAgent):
         注意4: 使用 order by 进行排序时。必须使用 nulls last 确保 null值不会对排序产生影响,使用方法如下: order by xxxx desc nulls last 或者 order by xxxx 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排序
+        注意6: 查询出地块。必须要对dkmj 进行desc排序。查询地块有数量限制时,比如'1宗','一宗','1块',使用limit 1语句;未限定时,只查询10宗,使用limit 10语句
         注意7: 问题中设计具体的地点时,需要使用round(st_distance(st_geometryfromtext('具体地点的wkt', 4528), st_transform(shape, 4528))::numeric,0)获取其distance, 如果问题未指定范围则使用 distance <= 5000 来限制在地点5公里内,并对其排序
         注意8: 当问题中提及周边分析的条件时,不需要将其转换为查询条件,比如交通便利,离港口码头近,人口等
         注意9: 生成sql时,只对涉及表结构中的字段进行条件设置,不可生成不在表字段列表中的查询条件,不可生成任何不在表字段中的条件,比如周边5公里有什么设施