intent(WHOLE、SEARCH_AUTHOR、SEARCH_NAME、PRE、NEXT、WHOLE_BY_CONTENT)
1.通过诗人随机返回一首诗
如:背一首李白的诗
请求数据(Request Data)
"query":'背一首李白的诗'
"custom_info": {
"intent":"WHOLE",
"slots":{
"name":"",
"author":"李白"
}
}
{
"service_ver": "1.0",
"bot_name": "项目名",
"user_id": "[UID]",
"query": "背一首李白的诗",
"req_type": "poet",
"send_time_ms": "",
"query_time_ms": "",
"debug": 0,
"location": {
"la": 40.0433,
"lo": 116.269,
"address": "北京市海淀区软件园西三路",
"country": "中国",
"province": "北京市",
"city": "北京",
"district": "海淀区",
"street": "软件园西三路"
},
"custom_info": {
"intent":"WHOLE",
"slots":{
"name":"",
"author":"李白"
}
}
}
响应数据(Response Data)
{
"status": 0,
"msg": "",
"callback_msg": null,
"data": [
{
"intent": "poet",
"intent_score": 100,
"terminal": 0,
"results": [
{
"reply": {
"content": "烛龙栖寒门,光曜犹旦开。日月照之何不及此?惟有北风号怒天上来。燕山雪花大如席,片片吹落轩辕台。幽州思妇十二月,停歌罢笑双蛾摧。倚门望行人,念君长城苦寒良可哀。别时提剑救边去,遗此虎文金鞞靫。中有一双白羽箭,蜘蛛结网生尘埃。箭空在,人今战死不复回。不忍见此物,焚之已成灰。黄河捧土尚可塞,北风雨雪恨难裁。",
"score": null,
"tts_text": "烛龙栖寒门,光曜犹旦开。日月照之何不及此?惟有北风号怒天上来。燕山雪花大如席,片片吹落轩辕台。幽州思妇十二月,停歌罢笑双蛾摧。倚门望行人,念君长城苦寒良可哀。别时提剑救边去,遗此虎文金鞞靫。中有一双白羽箭,蜘蛛结网生尘埃。箭空在,人今战死不复回。不忍见此物,焚之已成灰。黄河捧土尚可塞,北风雨雪恨难裁。",
"custom_info": [
{
"key": "type",
"value": "OFFER",
"info": null,
"value_json": []
},
{
"key": "poet.name",
"value": "北风行",
"info": null,
"value_json": []
},
{
"key": "poet.author",
"value": "李白",
"info": null,
"value_json": []
}
]
}
}
]
}
]
}
2.通过诗名查诗人
如:静夜思是谁的诗
请求数据(Request Data)
"query":'静夜思是谁的诗'
"custom_info": {
"intent":"SEARCH_AUTHOR",
"slots":{
"name":"",
"author":""
}
}
3.通过内容查诗人
如:床前明月光是谁的诗
请求数据(Request Data)
"query":'床前明月光是谁的诗'
"custom_info": {
"intent":"SEARCH_AUTHOR",
"slots":{
"name":"",
"author":""
}
}
4.通过内容查诗名
如:床前明月光出自哪首诗
请求数据(Request Data)
"query":'床前明月光出自哪首诗'
"custom_info": {
"intent":"SEARCH_NAME",
"slots":{
"name":"",
"author":""
}
}
5.查上一句诗
如: 疑是地上霜的上一句
请求数据(Request Data)
"query":'疑是地上霜的上一句'
"custom_info": {
"intent":"PRE",
"slots":{
"name":"",
"author":""
}
}
6.查下一句诗
如: 疑是地上霜的下一句
请求数据(Request Data)
"query":'疑是地上霜的下一句'
"custom_info": {
"intent":"NEXT",
"slots":{
"name":"",
"author":""
}
}
7.按诗句返回整首诗
如:床前明月光是什么诗?
请求数据(Request Data)
"query":'床前明月光是什么诗'
"custom_info": {
"intent":"WHOLE_BY_CONTENT",
"slots":{
"name":"",
"author":""
}
}