From a39355d49ef0919ddfc763b4791fc4de3f938d0c Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Mon, 9 Jun 2025 21:20:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E6=B2=89=E6=84=8F=E5=9B=BETop10JSONSc?= =?UTF-8?q?hema=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangzezhong --- .../userIntents_parser/parseUserIntents.ts | 2 +- .../schema/ControlPlayback_1.0.1.json | 27 ++- .../schema/PlayVideo_1.0.2.json | 61 +++++++ .../schema/RechargeCallFee_1.0.1.json | 48 ++++++ .../schema/RideHailing_1.0.2.json | 134 +++++++++++++++ .../schema/SendLogistics_1.0.1.json | 43 +++++ .../schema/StartNavigate_1.0.1.json | 157 ++++++++++++++++++ .../schema/ViewFlightTicket_1.0.1.json | 57 +++++++ .../schema/ViewLogistics_1.0.1.json | 50 ++++++ .../schema/ViewMap_1.0.1.json | 49 ++++++ .../schema/ViewTrainTicket_1.0.1.json | 64 +++++++ .../schema/ViewTravelCardCode_1.0.1.json | 52 ++++++ 12 files changed, 741 insertions(+), 3 deletions(-) create mode 100644 compiler/src/userIntents_parser/schema/PlayVideo_1.0.2.json create mode 100644 compiler/src/userIntents_parser/schema/RechargeCallFee_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/RideHailing_1.0.2.json create mode 100644 compiler/src/userIntents_parser/schema/SendLogistics_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/StartNavigate_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/ViewFlightTicket_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/ViewLogistics_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/ViewMap_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/ViewTrainTicket_1.0.1.json create mode 100644 compiler/src/userIntents_parser/schema/ViewTravelCardCode_1.0.1.json diff --git a/compiler/src/userIntents_parser/parseUserIntents.ts b/compiler/src/userIntents_parser/parseUserIntents.ts index 1554f107e..a5c970a40 100644 --- a/compiler/src/userIntents_parser/parseUserIntents.ts +++ b/compiler/src/userIntents_parser/parseUserIntents.ts @@ -869,7 +869,7 @@ class ParseIntent { if (fs.existsSync(schemaPath)) { const schemaContent: string = fs.readFileSync(schemaPath, 'utf-8'); const schemaObj: object = JSON.parse(schemaContent); - intentObj.parameters = schemaObj.params; + intentObj.parameters = schemaObj.parameters; intentObj.llmDescription = schemaObj.llmDescription; intentObj.keywords = schemaObj.keywords; intentObj.intentName = schemaObj.intentName; diff --git a/compiler/src/userIntents_parser/schema/ControlPlayback_1.0.1.json b/compiler/src/userIntents_parser/schema/ControlPlayback_1.0.1.json index 4619ef885..fa749ead2 100644 --- a/compiler/src/userIntents_parser/schema/ControlPlayback_1.0.1.json +++ b/compiler/src/userIntents_parser/schema/ControlPlayback_1.0.1.json @@ -3,7 +3,7 @@ "intentVersion": "1.0.1", "llmDescription": "播放音乐控制", "keywords": ["ControlPlayback"], - "params": { + "parameters": { "type": "object", "propertyNames": { "enum": [ @@ -37,9 +37,32 @@ ] }, "playbackProgress": { - "description": "播放进度,单位秒", + "description": "播放进度,单位秒。", "type": "number" } } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } } } diff --git a/compiler/src/userIntents_parser/schema/PlayVideo_1.0.2.json b/compiler/src/userIntents_parser/schema/PlayVideo_1.0.2.json new file mode 100644 index 000000000..3f556732c --- /dev/null +++ b/compiler/src/userIntents_parser/schema/PlayVideo_1.0.2.json @@ -0,0 +1,61 @@ +{ + "intentName": "PlayVideo", + "intentVersion": "1.0.2", + "llmDescription": "播放视频", + "keywords": ["PlayVideo"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "entityId", + "episodeId", + "episodeNumber", + "extras" + ] + }, + "required": [ + "entityId" + ], + "properties": { + "entityId": { + "description": "视频的唯一实体id。", + "type": "string" + }, + "episodeId": { + "description": "集数的唯一标识。", + "type": "string" + }, + "episodeNumber": { + "description": "视频的目标集数。", + "type": "number" + }, + "extras": { + "description": "其他信息扩展参数,具体由接入业务定义。", + "type": "object" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/RechargeCallFee_1.0.1.json b/compiler/src/userIntents_parser/schema/RechargeCallFee_1.0.1.json new file mode 100644 index 000000000..a66663a6e --- /dev/null +++ b/compiler/src/userIntents_parser/schema/RechargeCallFee_1.0.1.json @@ -0,0 +1,48 @@ +{ + "intentName": "RechargeCallFee", + "intentVersion": "1.0.1", + "llmDescription": "充值话费", + "keywords": ["RechargeCallFee"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "phoneNumber", + "amount" + ] + }, + "properties": { + "phoneNumber": { + "description": "手机号", + "type": "number" + }, + "amount": { + "description": "金额", + "type": "number" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "返回结果列表对象(列表Key名默认items),如果无内容则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/RideHailing_1.0.2.json b/compiler/src/userIntents_parser/schema/RideHailing_1.0.2.json new file mode 100644 index 000000000..19583d8ba --- /dev/null +++ b/compiler/src/userIntents_parser/schema/RideHailing_1.0.2.json @@ -0,0 +1,134 @@ +{ + "intentName": "RideHailing", + "intentVersion": "1.0.2", + "llmDescription": "开始打车", + "keywords": ["RideHailing"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "entityId", + "srcLocation", + "dstLocation", + "dstLocationType", + "hwChannelId", + "taxiType" + ] + }, + "properties": { + "entityId": { + "description": "视频的唯一实体id。", + "type": "string" + }, + "srcLocation": { + "description": "出发地信息,包括坐标系(缺省默认GCJ02),poi唯一标识,地点名称,经纬度,详细地址信息。", + "type": "object", + "properties": { + "poiId": { + "description": "唯一标识", + "type": "string" + }, + "locationName": { + "description": "地点名称", + "type": "string" + }, + "locationSystem": { + "description": "指定坐标系,(默认使用中国火星坐标系GCJ02)。", + "type": "string" + }, + "longitude": { + "description": "经度", + "type": "string" + }, + "latitude": { + "description": "纬度", + "type": "string" + }, + "address": { + "description": "详细地址信息", + "type": "string" + } + } + }, + "dstLocation": { + "description": "目的地的信息,包括坐标系(缺省默认GCJ02),poi的唯一标识,地点名称,经纬度,详细地址信息。", + "type": "object", + "properties": { + "poiId": { + "description": "唯一标识", + "type": "string" + }, + "locationName": { + "description": "地点名称", + "type": "string" + }, + "locationSystem": { + "description": "指定坐标系,(默认使用中国火星坐标系GCJ02)。", + "type": "string" + }, + "longitude": { + "description": "经度", + "type": "string" + }, + "latitude": { + "description": "纬度", + "type": "string" + }, + "address": { + "description": "详细地址信息", + "type": "string" + } + } + }, + "dstLocationType": { + "description": "目的地类型,比如'家'、'公司'。", + "type": "string" + }, + "hwChannelId": { + "description": "标识入口的渠道标识,0x00000100:小艺建议,0x00000200:小艺语音,0x00000300:拖拽入口。", + "type": "string", + "enum": [ + "0x00000100", + "0x00000200", + "0x00000300" + ] + }, + "taxiType": { + "description": "车型,0:默认,1:快车,2:出租车,3:拼车,4:顺风车,5:专车。", + "type": "number", + "default": 0, + "enum": [ + 0, + 1, + 2, + 3, + 4, + 5 + ] + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/SendLogistics_1.0.1.json b/compiler/src/userIntents_parser/schema/SendLogistics_1.0.1.json new file mode 100644 index 000000000..2e5b6a7c9 --- /dev/null +++ b/compiler/src/userIntents_parser/schema/SendLogistics_1.0.1.json @@ -0,0 +1,43 @@ +{ + "intentName": "SendLogistics", + "intentVersion": "1.0.1", + "llmDescription": "寄快递", + "keywords": ["SendLogistics"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "sendContent" + ] + }, + "properties": { + "sendContent": { + "description": "寄件信息。", + "type": "string" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "返回结果列表对象(列表Key名默认items),如果无内容则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/StartNavigate_1.0.1.json b/compiler/src/userIntents_parser/schema/StartNavigate_1.0.1.json new file mode 100644 index 000000000..53a888639 --- /dev/null +++ b/compiler/src/userIntents_parser/schema/StartNavigate_1.0.1.json @@ -0,0 +1,157 @@ +{ + "intentName": "StartNavigate", + "intentVersion": "1.0.1", + "llmDescription": "出行导航", + "keywords": ["StartNavigate"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "entityId", + "srcLocation", + "dstLocation", + "wayPoints", + "dstLocationType", + "trafficType" + ] + }, + "properties": { + "entityId": { + "description": "数据唯一标识。", + "type": "string" + }, + "srcLocation": { + "description": "出发地信息,包括坐标系(缺省默认GCJ02),poi唯一标识,地点名称,经纬度,详细地址信息。", + "type": "object", + "properties": { + "poiId": { + "description": "唯一标识", + "type": "string" + }, + "locationName": { + "description": "地点名称", + "type": "string" + }, + "locationSystem": { + "description": "指定坐标系,(默认使用中国火星坐标系GCJ02)。", + "type": "string" + }, + "longitude": { + "description": "经度", + "type": "string" + }, + "latitude": { + "description": "纬度", + "type": "string" + }, + "address": { + "description": "详细地址信息。", + "type": "string" + } + } + }, + "dstLocation": { + "description": "目的地的信息,包括坐标系(缺省默认GCJ02),poi的唯一标识,地点名称,经纬度,详细地址信息。", + "type": "object", + "properties": { + "poiId": { + "description": "唯一标识", + "type": "string" + }, + "locationName": { + "description": "地点名称", + "type": "string" + }, + "locationSystem": { + "description": "指定坐标系,(默认使用中国火星坐标系GCJ02)。", + "type": "string" + }, + "longitude": { + "description": "经度", + "type": "string" + }, + "latitude": { + "description": "纬度", + "type": "string" + }, + "address": { + "description": "详细地址信息", + "type": "string" + } + } + }, + "wayPoints": { + "description": "途经点列表,最多传5个。", + "type": "array", + "items": { + "type": "object", + "properties": { + "poiId": { + "description": "唯一标识", + "type": "string" + }, + "locationName": { + "description": "地点名称", + "type": "string" + }, + "locationSystem": { + "description": "坐标系", + "type": "string" + }, + "longitude": { + "description": "经度", + "type": "string" + }, + "latitude": { + "description": "纬度", + "type": "string" + }, + "address": { + "description": "详细地址信息", + "type": "string" + } + } + } + }, + "dstLocationType": { + "description": "目的地类型,比如'家'、'公司'。", + "type": "string" + }, + "trafficType": { + "description": "交通方式(类型),包括驾车、步行、骑行、公交地铁。", + "type": "string", + "enum": [ + "Drive", + "Walk", + "Cycle", + "Bus", + "Subway" + ], + "default":"Drive" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/ViewFlightTicket_1.0.1.json b/compiler/src/userIntents_parser/schema/ViewFlightTicket_1.0.1.json new file mode 100644 index 000000000..43d22c690 --- /dev/null +++ b/compiler/src/userIntents_parser/schema/ViewFlightTicket_1.0.1.json @@ -0,0 +1,57 @@ +{ + "intentName": "ViewFlightTicket", + "intentVersion": "1.0.1", + "llmDescription": "查看机票", + "keywords": ["ViewFlightTicket"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "entityId", + "cabin" + ] + }, + "required": [ + "entityId" + ], + "properties": { + "entityId": { + "description": "数据唯一标识。", + "type": "number" + }, + "cabin": { + "description": "舱位:经济舱、头等舱、公务舱、超级经济舱。", + "type": "string", + "enum": [ + "经济舱", + "头等舱", + "公务舱", + "超级经济舱" + ] + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/ViewLogistics_1.0.1.json b/compiler/src/userIntents_parser/schema/ViewLogistics_1.0.1.json new file mode 100644 index 000000000..efe5fac4d --- /dev/null +++ b/compiler/src/userIntents_parser/schema/ViewLogistics_1.0.1.json @@ -0,0 +1,50 @@ +{ + "intentName": "ViewLogistics", + "intentVersion": "1.0.1", + "llmDescription": "查看快递", + "keywords": ["ViewLogistics"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "trackingNo", + "entityId" + ] + }, + "properties": { + "trackingNo": { + "description": "快递单号,空则停留在首页。", + "maxLength": 64, + "type": "string" + }, + "entityId": { + "description": "快递实体ID,查询场景下默认使用该字段回传打开。", + "maxLength": 64, + "type": "string" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "返回结果列表对象(列表Key名默认items),如果无内容则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/ViewMap_1.0.1.json b/compiler/src/userIntents_parser/schema/ViewMap_1.0.1.json new file mode 100644 index 000000000..61e8833e7 --- /dev/null +++ b/compiler/src/userIntents_parser/schema/ViewMap_1.0.1.json @@ -0,0 +1,49 @@ +{ + "intentName": "ViewMap", + "intentVersion": "1.0.1", + "llmDescription": "查看地图", + "keywords": ["ViewMap"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "mapType" + ] + }, + "properties": { + "mapType": { + "description": "地图类型,枚举,Satellite:卫星地图,Standard:标准地图(默认),3D:3D地图。", + "type": "string", + "enum": [ + "Satellite", + "Standard", + "3D" + ], + "default": "Standard" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/ViewTrainTicket_1.0.1.json b/compiler/src/userIntents_parser/schema/ViewTrainTicket_1.0.1.json new file mode 100644 index 000000000..61f935f9a --- /dev/null +++ b/compiler/src/userIntents_parser/schema/ViewTrainTicket_1.0.1.json @@ -0,0 +1,64 @@ +{ + "intentName": "ViewTrainTicket", + "intentVersion": "1.0.1", + "llmDescription": "查看火车票", + "keywords": ["ViewTrainTicket"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "entityId", + "seatLevelShow" + ] + }, + "required": [ + "entityId" + ], + "properties": { + "entityId": { + "description": "数据唯一标识。", + "type": "number" + }, + "seatLevelShow": { + "description": "座位类型", + "type": "string", + "enum": [ + "二等座", + "二等卧", + "一等座", + "一等卧", + "商务座", + "硬座", + "软座", + "硬卧", + "软卧", + "高软", + "无座" + ] + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} diff --git a/compiler/src/userIntents_parser/schema/ViewTravelCardCode_1.0.1.json b/compiler/src/userIntents_parser/schema/ViewTravelCardCode_1.0.1.json new file mode 100644 index 000000000..2bfc0204d --- /dev/null +++ b/compiler/src/userIntents_parser/schema/ViewTravelCardCode_1.0.1.json @@ -0,0 +1,52 @@ +{ + "intentName": "ViewTravelCardCode", + "intentVersion": "1.0.1", + "llmDescription": "查看乘车码", + "keywords": ["ViewTravelCardCode"], + "parameters": { + "type": "object", + "propertyNames": { + "enum": [ + "travelCardType", + "adminCode" + ] + }, + "properties": { + "travelCardType": { + "description": "缺省上次用户查看(由APP自行实现逻辑),枚举,Metro:地铁,Bus:公交。", + "type": "string", + "enum": [ + "Metro", + "Bus" + ] + }, + "adminCode": { + "description": "用户所在城市(未传时默认为APP自行获取用户当前位置城市),使用中国城市编码,定义参考https://developer.huawei.com/consumer/cn/doc/HMSCore-References/city-code-value-0000001540077092。", + "type": "number" + } + } + }, + "result": { + "type": "object", + "propertyNames": { + "enum": [ + "code", + "result" + ] + }, + "required": [ + "code", + "result" + ], + "properties": { + "code": { + "description": "意图调用返回的结果码,0代表成功。", + "type": "number" + }, + "result": { + "description": "意图调用返回的数据,如果无数据则返回空。", + "type": "object" + } + } + } +} -- Gitee