Train a Rasa model
Trains a new Rasa model. Depending on the data given only a dialogue model, only a NLU model, or a model combining a trained dialogue model with an NLU model will be trained. The new model is not loaded by default.
curl --request POST \
--url 'http://localhost:5005/model/train?token=' \
--header 'Content-Type: application/yaml' \
--data '
"pipeline: []\n\npolicies: []\n\nintents:\n - greet\n - goodbye\n\nentities: []\n\nslots:\n contacts_list:\n type: text\n mappings:\n - type: custom\n action: list_contacts\n\nactions:\n - list_contacts\n\nforms: {}\ne2e_actions: []\n\nresponses:\n utter_greet:\n - text: \"Hey! How are you?\"\n\n utter_goodbye:\n - text: \"Bye\"\n\n utter_list_contacts:\n - text: \"You currently have the following contacts:\\n{contacts_list}\"\n\n utter_no_contacts:\n - text: \"You have no contacts in your list.\"\n\nsession_config:\n session_expiration_time: 60\n carry_over_slots_to_new_session: true\n\nnlu:\n- intent: greet\n examples: |\n - hey\n - hello\n\n- intent: goodbye\n examples: |\n - bye\n - goodbye\n\nrules:\n\n- rule: Say goodbye anytime the user says goodbye\n steps:\n - intent: goodbye\n - action: utter_goodbye\n\nstories:\n\n- story: happy path\n steps:\n - intent: greet\n - action: utter_greet\n - intent: goodbye\n - action: utter_goodbye\n\nflows:\n list_contacts:\n name: list your contacts\n description: show your contact list\n steps:\n - action: list_contacts\n next:\n - if: \"slots.contacts_list\"\n then:\n - action: utter_list_contacts\n next: END\n - else:\n - action: utter_no_contacts\n next: END\n"
'import requests
url = "http://localhost:5005/model/train?token="
payload = "pipeline: []
policies: []
intents:
- greet
- goodbye
entities: []
slots:
contacts_list:
type: text
mappings:
- type: custom
action: list_contacts
actions:
- list_contacts
forms: {}
e2e_actions: []
responses:
utter_greet:
- text: \"Hey! How are you?\"
utter_goodbye:
- text: \"Bye\"
utter_list_contacts:
- text: \"You currently have the following contacts:\n{contacts_list}\"
utter_no_contacts:
- text: \"You have no contacts in your list.\"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
nlu:
- intent: greet
examples: |
- hey
- hello
- intent: goodbye
examples: |
- bye
- goodbye
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
stories:
- story: happy path
steps:
- intent: greet
- action: utter_greet
- intent: goodbye
- action: utter_goodbye
flows:
list_contacts:
name: list your contacts
description: show your contact list
steps:
- action: list_contacts
next:
- if: \"slots.contacts_list\"
then:
- action: utter_list_contacts
next: END
- else:
- action: utter_no_contacts
next: END
"
headers = {"Content-Type": "application/yaml"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/yaml'},
body: JSON.stringify('pipeline: []\n\npolicies: []\n\nintents:\n - greet\n - goodbye\n\nentities: []\n\nslots:\n contacts_list:\n type: text\n mappings:\n - type: custom\n action: list_contacts\n\nactions:\n - list_contacts\n\nforms: {}\ne2e_actions: []\n\nresponses:\n utter_greet:\n - text: "Hey! How are you?"\n\n utter_goodbye:\n - text: "Bye"\n\n utter_list_contacts:\n - text: "You currently have the following contacts:\n{contacts_list}"\n\n utter_no_contacts:\n - text: "You have no contacts in your list."\n\nsession_config:\n session_expiration_time: 60\n carry_over_slots_to_new_session: true\n\nnlu:\n- intent: greet\n examples: |\n - hey\n - hello\n\n- intent: goodbye\n examples: |\n - bye\n - goodbye\n\nrules:\n\n- rule: Say goodbye anytime the user says goodbye\n steps:\n - intent: goodbye\n - action: utter_goodbye\n\nstories:\n\n- story: happy path\n steps:\n - intent: greet\n - action: utter_greet\n - intent: goodbye\n - action: utter_goodbye\n\nflows:\n list_contacts:\n name: list your contacts\n description: show your contact list\n steps:\n - action: list_contacts\n next:\n - if: "slots.contacts_list"\n then:\n - action: utter_list_contacts\n next: END\n - else:\n - action: utter_no_contacts\n next: END\n')
};
fetch('http://localhost:5005/model/train?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "5005",
CURLOPT_URL => "http://localhost:5005/model/train?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('pipeline: []
policies: []
intents:
- greet
- goodbye
entities: []
slots:
contacts_list:
type: text
mappings:
- type: custom
action: list_contacts
actions:
- list_contacts
forms: {}
e2e_actions: []
responses:
utter_greet:
- text: "Hey! How are you?"
utter_goodbye:
- text: "Bye"
utter_list_contacts:
- text: "You currently have the following contacts:\\n{contacts_list}"
utter_no_contacts:
- text: "You have no contacts in your list."
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
nlu:
- intent: greet
examples: |
- hey
- hello
- intent: goodbye
examples: |
- bye
- goodbye
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
stories:
- story: happy path
steps:
- intent: greet
- action: utter_greet
- intent: goodbye
- action: utter_goodbye
flows:
list_contacts:
name: list your contacts
description: show your contact list
steps:
- action: list_contacts
next:
- if: "slots.contacts_list"
then:
- action: utter_list_contacts
next: END
- else:
- action: utter_no_contacts
next: END
'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/yaml"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:5005/model/train?token="
payload := strings.NewReader("\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:5005/model/train?token=")
.header("Content-Type", "application/yaml")
.body("\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\"")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5005/model/train?token=")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/yaml'
request.body = "\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\""
response = http.request(request)
puts response.read_body"<string>"{
"version": "1.0.0",
"status": "failure",
"reason": "BadRequest",
"code": 400
}{
"version": "1.0.0",
"status": "failure",
"reason": "NotAuthenticated",
"message": "User is not authenticated to access resource.",
"code": 401
}{
"version": "1.0.0",
"status": "failure",
"reason": "NotAuthorized",
"message": "User has insufficient permission to access resource.",
"code": 403
}{
"version": "1.0.0",
"status": "ServerError",
"message": "An unexpected error occurred.",
"code": 500
}Authorizations
A plaintext token to secure your server, specified at startup in the argument --auth-token thisismysecret
Query Parameters
If true (default) the trained model will be saved in the default model directory, if false it will be saved in a temporary directory
Force a model training even if the data has not changed
How much data augmentation to use during training
Maximum amount of threads to use when training
If specified the call will return immediately with an empty response and status code 204. The actual result or any errors will be sent to the given callback URL as the body of a post request.
Body
The training data should be in YAML format.
Pipeline list
Policies list
Entity list
Slots list
Action list
Forms list
E2E Action list
Bot response templates
Show child attributes
Show child attributes
Session configuration options
Show child attributes
Show child attributes
Rasa NLU data, array of intents
Rule list
Rasa Core stories in YAML format
Rasa Pro flows in YAML format
Force a model training even if the data has not changed
false
If true (default) the trained model will be saved in the default model directory, if false it will be saved in a temporary directory
Response
Zipped Rasa model
The response is of type file.
curl --request POST \
--url 'http://localhost:5005/model/train?token=' \
--header 'Content-Type: application/yaml' \
--data '
"pipeline: []\n\npolicies: []\n\nintents:\n - greet\n - goodbye\n\nentities: []\n\nslots:\n contacts_list:\n type: text\n mappings:\n - type: custom\n action: list_contacts\n\nactions:\n - list_contacts\n\nforms: {}\ne2e_actions: []\n\nresponses:\n utter_greet:\n - text: \"Hey! How are you?\"\n\n utter_goodbye:\n - text: \"Bye\"\n\n utter_list_contacts:\n - text: \"You currently have the following contacts:\\n{contacts_list}\"\n\n utter_no_contacts:\n - text: \"You have no contacts in your list.\"\n\nsession_config:\n session_expiration_time: 60\n carry_over_slots_to_new_session: true\n\nnlu:\n- intent: greet\n examples: |\n - hey\n - hello\n\n- intent: goodbye\n examples: |\n - bye\n - goodbye\n\nrules:\n\n- rule: Say goodbye anytime the user says goodbye\n steps:\n - intent: goodbye\n - action: utter_goodbye\n\nstories:\n\n- story: happy path\n steps:\n - intent: greet\n - action: utter_greet\n - intent: goodbye\n - action: utter_goodbye\n\nflows:\n list_contacts:\n name: list your contacts\n description: show your contact list\n steps:\n - action: list_contacts\n next:\n - if: \"slots.contacts_list\"\n then:\n - action: utter_list_contacts\n next: END\n - else:\n - action: utter_no_contacts\n next: END\n"
'import requests
url = "http://localhost:5005/model/train?token="
payload = "pipeline: []
policies: []
intents:
- greet
- goodbye
entities: []
slots:
contacts_list:
type: text
mappings:
- type: custom
action: list_contacts
actions:
- list_contacts
forms: {}
e2e_actions: []
responses:
utter_greet:
- text: \"Hey! How are you?\"
utter_goodbye:
- text: \"Bye\"
utter_list_contacts:
- text: \"You currently have the following contacts:\n{contacts_list}\"
utter_no_contacts:
- text: \"You have no contacts in your list.\"
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
nlu:
- intent: greet
examples: |
- hey
- hello
- intent: goodbye
examples: |
- bye
- goodbye
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
stories:
- story: happy path
steps:
- intent: greet
- action: utter_greet
- intent: goodbye
- action: utter_goodbye
flows:
list_contacts:
name: list your contacts
description: show your contact list
steps:
- action: list_contacts
next:
- if: \"slots.contacts_list\"
then:
- action: utter_list_contacts
next: END
- else:
- action: utter_no_contacts
next: END
"
headers = {"Content-Type": "application/yaml"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/yaml'},
body: JSON.stringify('pipeline: []\n\npolicies: []\n\nintents:\n - greet\n - goodbye\n\nentities: []\n\nslots:\n contacts_list:\n type: text\n mappings:\n - type: custom\n action: list_contacts\n\nactions:\n - list_contacts\n\nforms: {}\ne2e_actions: []\n\nresponses:\n utter_greet:\n - text: "Hey! How are you?"\n\n utter_goodbye:\n - text: "Bye"\n\n utter_list_contacts:\n - text: "You currently have the following contacts:\n{contacts_list}"\n\n utter_no_contacts:\n - text: "You have no contacts in your list."\n\nsession_config:\n session_expiration_time: 60\n carry_over_slots_to_new_session: true\n\nnlu:\n- intent: greet\n examples: |\n - hey\n - hello\n\n- intent: goodbye\n examples: |\n - bye\n - goodbye\n\nrules:\n\n- rule: Say goodbye anytime the user says goodbye\n steps:\n - intent: goodbye\n - action: utter_goodbye\n\nstories:\n\n- story: happy path\n steps:\n - intent: greet\n - action: utter_greet\n - intent: goodbye\n - action: utter_goodbye\n\nflows:\n list_contacts:\n name: list your contacts\n description: show your contact list\n steps:\n - action: list_contacts\n next:\n - if: "slots.contacts_list"\n then:\n - action: utter_list_contacts\n next: END\n - else:\n - action: utter_no_contacts\n next: END\n')
};
fetch('http://localhost:5005/model/train?token=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "5005",
CURLOPT_URL => "http://localhost:5005/model/train?token=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode('pipeline: []
policies: []
intents:
- greet
- goodbye
entities: []
slots:
contacts_list:
type: text
mappings:
- type: custom
action: list_contacts
actions:
- list_contacts
forms: {}
e2e_actions: []
responses:
utter_greet:
- text: "Hey! How are you?"
utter_goodbye:
- text: "Bye"
utter_list_contacts:
- text: "You currently have the following contacts:\\n{contacts_list}"
utter_no_contacts:
- text: "You have no contacts in your list."
session_config:
session_expiration_time: 60
carry_over_slots_to_new_session: true
nlu:
- intent: greet
examples: |
- hey
- hello
- intent: goodbye
examples: |
- bye
- goodbye
rules:
- rule: Say goodbye anytime the user says goodbye
steps:
- intent: goodbye
- action: utter_goodbye
stories:
- story: happy path
steps:
- intent: greet
- action: utter_greet
- intent: goodbye
- action: utter_goodbye
flows:
list_contacts:
name: list your contacts
description: show your contact list
steps:
- action: list_contacts
next:
- if: "slots.contacts_list"
then:
- action: utter_list_contacts
next: END
- else:
- action: utter_no_contacts
next: END
'),
CURLOPT_HTTPHEADER => [
"Content-Type: application/yaml"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://localhost:5005/model/train?token="
payload := strings.NewReader("\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\"")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/yaml")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("http://localhost:5005/model/train?token=")
.header("Content-Type", "application/yaml")
.body("\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\"")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5005/model/train?token=")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/yaml'
request.body = "\"pipeline: []\\n\\npolicies: []\\n\\nintents:\\n - greet\\n - goodbye\\n\\nentities: []\\n\\nslots:\\n contacts_list:\\n type: text\\n mappings:\\n - type: custom\\n action: list_contacts\\n\\nactions:\\n - list_contacts\\n\\nforms: {}\\ne2e_actions: []\\n\\nresponses:\\n utter_greet:\\n - text: \\\"Hey! How are you?\\\"\\n\\n utter_goodbye:\\n - text: \\\"Bye\\\"\\n\\n utter_list_contacts:\\n - text: \\\"You currently have the following contacts:\\\\n{contacts_list}\\\"\\n\\n utter_no_contacts:\\n - text: \\\"You have no contacts in your list.\\\"\\n\\nsession_config:\\n session_expiration_time: 60\\n carry_over_slots_to_new_session: true\\n\\nnlu:\\n- intent: greet\\n examples: |\\n - hey\\n - hello\\n\\n- intent: goodbye\\n examples: |\\n - bye\\n - goodbye\\n\\nrules:\\n\\n- rule: Say goodbye anytime the user says goodbye\\n steps:\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nstories:\\n\\n- story: happy path\\n steps:\\n - intent: greet\\n - action: utter_greet\\n - intent: goodbye\\n - action: utter_goodbye\\n\\nflows:\\n list_contacts:\\n name: list your contacts\\n description: show your contact list\\n steps:\\n - action: list_contacts\\n next:\\n - if: \\\"slots.contacts_list\\\"\\n then:\\n - action: utter_list_contacts\\n next: END\\n - else:\\n - action: utter_no_contacts\\n next: END\\n\""
response = http.request(request)
puts response.read_body"<string>"{
"version": "1.0.0",
"status": "failure",
"reason": "BadRequest",
"code": 400
}{
"version": "1.0.0",
"status": "failure",
"reason": "NotAuthenticated",
"message": "User is not authenticated to access resource.",
"code": 401
}{
"version": "1.0.0",
"status": "failure",
"reason": "NotAuthorized",
"message": "User has insufficient permission to access resource.",
"code": 403
}{
"version": "1.0.0",
"status": "ServerError",
"message": "An unexpected error occurred.",
"code": 500
}