...
Code Block | ||||
---|---|---|---|---|
| ||||
... "children": [ { "type": "negation", "children": [ <any other conditions> ] } ] ... |
The API endpoints :
HTTP Method | API Endpoint | Request Body | Response |
---|---|---|---|
DELETE | /behaviorstore/behaviorsets/{id} | N/A | N/A |
GET | /behaviorstore/behaviorsets/{id} | N/A | BehaviorSet model |
PUT | /behaviorstore/behaviorsets/{id} |
...
BehaviorSet model | N/A | ||
GET | /behaviorstore/behaviorsets/descriptors | N/A | BehaviorSet model |
POST | /behaviorstore/behaviorsets | BehaviorSet model | N/A |
GET | /behaviorstore/behaviorsets/{id}/currentversion | N/A | BehaviorSet model |
POST | /behaviorstore/behaviorsets/{id}/currentversion | BehaviorSet model | N/A |
Example
We will demonstrate here the creation of a BehaviorSet
behaviorsets
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Request URL
POST http://localhost:7070/behaviorstore/behaviorsets
Request Body
{
"behaviorGroups": [
{
"name": "Smalltalk",
"behaviorRules": [
{
"name": "Welcome",
"actions": [
"welcome"
],
"children": [
{
"type": "negation",
"children": [
{
"type": "occurrence",
"values": {
"maxTimesOccurred": 1,
"behaviorRuleName": "Welcome"
}
}
]
}
]
},
{
"name": "Greeting",
"actions": [
"greet"
],
"children": [
{
"type": "inputmatcher",
"values": {
"expressions": "greeting(*)",
"occurrence": "currentStep"
}
}
]
},
{
"name": "Goodbye",
"actions": [
"say_goodbye",
"CONVERSATION_END"
],
"children": [
{
"type": "inputmatcher",
"values": {
"expressions": "goodbye(*)"
}
}
]
},
{
"name": "Thank",
"actions": [
"thank"
],
"children": [
{
"type": "inputmatcher",
"values": {
"expressions": "thank(*)"
}
}
]
},
{
"name": "how are you",
"actions": [
"how_are_you"
],
"children": [
{
"type": "inputmatcher",
"values": {
"expressions": "how_are_you"
}
}
]
}
]
}
]
}
Response Body
no content
Response Code
201
Response Headers
{
"access-control-allow-origin": "*",
"date": "Thu, 21 Jun 2018 01:00:02 GMT",
"access-control-allow-headers": "authorization, Content-Type",
"content-length": "0",
"location": "eddi://ai.labs.behavior/behaviorstore/behaviorsets/5b2af892ee5ee72440ee1b4b?version=1",
"access-control-allow-methods": "GET, PUT, POST, DELETE, PATCH, OPTIONS",
"access-control-expose-headers": "location",
"content-type": null
} |