Model
Parse a message using the Rasa model
Predicts the intent and entities of the message posted to this endpoint. No messages will be stored to a conversation and no action will be run. This will just retrieve the NLU parse results.
POST
/
model
/
parse
Parse a message using the Rasa model
curl --request POST \
--url 'http://localhost:5005/model/parse?token=' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, I am Rasa!",
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a"
}
'import requests
url = "http://localhost:5005/model/parse?token="
payload = {
"text": "Hello, I am Rasa!",
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Hello, I am Rasa!', message_id: 'b2831e73-1407-4ba0-a861-0f30a42a2a5a'})
};
fetch('http://localhost:5005/model/parse?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/parse?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([
'text' => 'Hello, I am Rasa!',
'message_id' => 'b2831e73-1407-4ba0-a861-0f30a42a2a5a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/parse?token="
payload := strings.NewReader("{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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/parse?token=")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5005/model/parse?token=")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}"
response = http.request(request)
puts response.read_body{
"text": "Hello!",
"entities": [
{
"start": 123,
"end": 123,
"value": "<string>",
"entity": "<string>",
"confidence": 123
}
],
"intent": {
"confidence": 0.6323,
"name": "greet"
},
"commands": [
{
"command": "start flow",
"flow": "transfer_money"
}
]
}{
"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
TokenAuthJWT
A plaintext token to secure your server, specified at startup in the argument --auth-token thisismysecret
Query Parameters
Specify the emulation mode to use. Emulation mode transforms the response JSON to the format expected by the service specified as the emulation_mode. Requests must still be sent in the regular Rasa format.
Available options:
WIT, LUIS, DIALOGFLOW Body
application/json
Message to be parsed
Example:
"Hello, I am Rasa!"
Optional ID for message to be parsed
Example:
"b2831e73-1407-4ba0-a861-0f30a42a2a5a"
Response
Success
NLU parser information. If set, message will not be passed through NLU, but instead this parsing information will be used.
⌘I
Parse a message using the Rasa model
curl --request POST \
--url 'http://localhost:5005/model/parse?token=' \
--header 'Content-Type: application/json' \
--data '
{
"text": "Hello, I am Rasa!",
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a"
}
'import requests
url = "http://localhost:5005/model/parse?token="
payload = {
"text": "Hello, I am Rasa!",
"message_id": "b2831e73-1407-4ba0-a861-0f30a42a2a5a"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({text: 'Hello, I am Rasa!', message_id: 'b2831e73-1407-4ba0-a861-0f30a42a2a5a'})
};
fetch('http://localhost:5005/model/parse?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/parse?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([
'text' => 'Hello, I am Rasa!',
'message_id' => 'b2831e73-1407-4ba0-a861-0f30a42a2a5a'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/parse?token="
payload := strings.NewReader("{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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/parse?token=")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:5005/model/parse?token=")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"text\": \"Hello, I am Rasa!\",\n \"message_id\": \"b2831e73-1407-4ba0-a861-0f30a42a2a5a\"\n}"
response = http.request(request)
puts response.read_body{
"text": "Hello!",
"entities": [
{
"start": 123,
"end": 123,
"value": "<string>",
"entity": "<string>",
"confidence": 123
}
],
"intent": {
"confidence": 0.6323,
"name": "greet"
},
"commands": [
{
"command": "start flow",
"flow": "transfer_money"
}
]
}{
"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
}