API
minarai-applicationのAPI
Engine ¶
リクエストするエンジンを選択して、ポストする ¶
リクエストするエンジンを選択して、ポストするPOST/engine/pre_selector
(非同期)
Example URI
POST /engine/pre_selector
Request
Headers
Content-Type: application/json
Body
{
"head": {
"userId": 1,
"clientId": 2,
"deviceId": 3,
"requestId": "うけとったrequestId",
"callBackUri": "dialoguehubのuri",
"params": {},
"body": {
"userUtterance": "ユーザーの発話"
}
}
}
Response
200
Headers
Content-Type: application/json
Body
リクエストのBodyで判断して、engineNameを配列で返す
engineNameはデベロッパーコンソールで選択したエンジンの名前
{
"engineName": [
"hrime_name1"
],
"requestId": "受け取ったrequestId"
}
Response
400
Body
URIのエラー(dialogueが動いてないなど)
Response
500
Body
エラーメッセージ
エンジンからのレスポンスをうけとって、加工してポストする ¶
エンジンからのレスポンスをうけとって、加工してポストするPOST/engine/post_selector
(非同期)
Example URI
POST /engine/post_selector
Request
Headers
Content-Type: application/json
Body
body[].bodyの中にボット発話,uiCommandを入れる想定
{
"head": {
"userId": 1,
"clientId": 2,
"deviceId": 3,
"requestId": "うけとったrequestId",
"callBackUri": "dialoguehubのuri",
"params": {}
},
"body": {
"userUtterance": "ユーザーの発話「こんにちは」",
"engineResponses": [{
"": "chatbotの場合",
"engineType": "hrime",
"engineName": "hrime_name1",
"body": {
"domain": "chatbot",
"concepts": {
"response": {
"balloon": "Any",
"frame_type": "Any",
"type": "sorry",
"face": "Any",
"level": "Any",
"value": "ボットの発話「こんにちは、今日もいい天気」"
}
},
"": "暫定対応",
"id": 123456
}
},
{
"": "templateの場合",
"engineType": "hrime",
"engineName": "hrime_name2",
"body": {
"domain": "example",
"subDomain": "food_and_human",
"action": "start",
"concepts": {
"prefered_food": "みかん"
},
"//": "暫定対応",
"id": 123456
}
}
]
}
}
Response
200
Headers
Content-Type: application/json
Body
bodyフィールドは必須項目、デベロッパーがこれ以外に任意のフィールドを追加してOK
{
"head": {
"engineType": "hrime",
"engineName": "hrime_name1",
"requestId": "うけとったrequestId"
},
"body": {
"messages": [{
"value": "ボットの発話",
"extra": {
"balloon": "Any",
"frame_type": "Any",
"type": "sorry",
"face": "Any",
"level": "Any"
}
}],
"extra": {
"/": "暫定対応",
"id": 123456,
"//": "templateの場合は必須",
"nextState": 2
}
}
}
Response
400
Body
URIのエラー(dialogueが動いてないなど)
Response
500
Body
エラーメッセージ
クライアントからのコマンドを操作する ¶
クライアントからのコマンドを操作するPOST/engine/systemcommand
(同期)
Example URI
POST /engine/systemcommand
Request
Headers
Content-Type: application/json
Body
{
"userId": 1,
"clientId": 2,
"deviceId": 3,
"params": {}
}
Response
200
Headers
Content-Type: application/json
Body
JSON形式ならなんでもOK
{
"": ""
}
Response
500
Body
エラーメッセージ
Operator ¶
オペレーター操作 ¶
オペレーター操作POST/operator/message
Example URI
POST /operator/message
Request
Headers
Content-Type: application/json
Body
{
"head": {
"userId": "1",
"clientId": "2",
"deviceId": "3"
},
"body": {
"message": [
{
"value": "オペレーター発話",
"uiCommand": "smile",
"": "JSONでなにか",
"extra": {}
}
],
"": "JSONでなにか",
"extra": {}
}
}
Response
200
Headers
Content-Type: application/json
Body
{
"message": [
{
"value": "オペレーター発話",
"uiCommand": "smile",
"": "JSONでなにか",
"extra": {}
}
],
"": "JSONでなにか",
"extra": {}
}