Hi,
I have Rasa installed with MITIE backend. I trained my models from API.ai, using my own and using the ones I found in the examples folder. Unfortunately, it responds with an empty "fulfillment" every time I make a query. Please advise.
Best,
Aaron
Hi Aaron,
Thanks for this. I need a little more detail from you. I haven't used it, but looking at the api.ai docs, it seems the purpose of the fulfillment field is to fetch additional data to add to the response, e.g. calling an external API or something. Is that right? If so, could you please provide an example of how you would like to use it, and what response you would expect?
Hi,
Thanks for the reply. Fulfillment is used to provide a speech response for a bot to say/send to the user. Contexts are used in API.ai to explain which parameters have been captured by a bot. So, in a full API.ai response you would get something like this...
````
{
"id": "170a3fc2-1596-4e0e-adf6-55a68b41991e",
"timestamp": "2016-11-03T14:42:13.473Z",
"result": {
"source": "agent",
"resolvedQuery": "my name is Sam and I live in Paris",
"action": "greetings",
"actionIncomplete": false,
"parameters": {
"city": "Paris",
"name": "Sam"
},
"contexts": [
{
"name": "greetings",
"parameters": {
"name.original": "Sam",
"city": "Paris",
"name": "Sam",
"city.original": "Paris"
},
"lifespan": 5
}
],
"metadata": {
"intentId": "51ee06e9-9ff5-428b-aafd-733bbd7e9978",
"webhookUsed": "false",
"intentName": "greetings"
},
"fulfillment": {
"speech": "Hi Sam! Nice to meet you!",
"messages": [
{
"type": 0,
"speech": "Hi Sam! Nice to meet you!"
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "0723d23f-88e0-49f8-adb3-2034a1612f81"
}
````
However, in Rasa, we only get the following...
````
{
"status": {
"errorType": "success",
"code": 200
},
"timestamp": "2017-01-08T10:58:44.037705",
"sessionId": "54d74fd0-d5bb-11e6-8522-a41731f7a3eb",
"id": "54d74fce-d5bb-11e6-8522-a41731f7a3eb",
"result": {
"score": null,
"source": "agent",
"contexts": [
],
"parameters": {
},
"actionIncomplete": null,
"action": null,
"resolvedQuery": "hi",
"fulfillment": {
},
"metadata": {
"intentId": "54d74fcf-d5bb-11e6-8522-a41731f7a3eb",
"intentName": "hi",
"webhookUsed": "false"
}
}
}
````
Not only is there no context, but the response I'm supposed to send to the user is also missing.
Fulfillment.speech is use as the base response to the user.
Fulfillment.messages is an array of possible response to the user. This can be use to send multiple messages in response to one query... like, breaking the text apart so it doesn't exceed max character rules of the messaging platform.
Parameters are used to capture input from the user. These are included in the context. The context is used to keep the current session in the correct intent until all parameters are captured.
Thanks for this. Yes it looks like a bug that you're not getting anything in the context field.
Regarding the fulfilment part, this is currently not part of rasa NLU's functionality. The idea is just to understand what a user says and respond with an intent and a list of entities. How your bot responds to that information should then be handled by your code.
Adding a bug label regarding the empty contexts. Could you please provide some of your training data required for reproducing the requests? (if you prefer you can email it to me, check my profile for address).
Hi @aaronfranco, thank you for having opened the issue! :)
I think Alan explained well for what concerns the fullfillment itself, so I will focus on the context. From what I can see those informations are included also in other fields like:
am I right? If so I am working on a small patch that will fill those fields as well.
Thank you
Closing this - please reopen if still an issue
Hi Guys,
I am having a similar issue when trying to convert from api.ai to rasa.
Context is missing for me in the rasa response (i am emulating api.ai)
"result": {
"action": null,
"actionIncomplete": null,
"contexts": [],
"fulfillment": {},
"metadata": {
"intentId": "e3f403c5-30c3-11e7-878b-000c294c42a6",
"intentName": {
"confidence": 0.6258991950183441,
"name": "headcount.request"
},
"webhookUsed": "false"
},
while if i run same request in api.ai i get following:
"id": "3032e196-cab9-4a0c-aeb8-f8bdbba1b0fc",
"timestamp": "2017-05-04T12:18:38.097Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "give me number of employee-test in company-test in 2016 november",
"action": "buildManpowerQuery",
"actionIncomplete": false,
"parameters": {
"attribute": [
"employee-test"
],
"company": "company-test",
"month": "November",
"year": [
"2016"
]
},
"contexts": [
{
"name": "output-context",
"parameters": {
"month": "November",
"company.original": "company-test",
"attribute.original": "employee-test",
"year": [
"2016"
],
"month.original": "november",
"company": "company-test",
"attribute": [
"employee-test"
],
"year.original": "2016"
},
I'm also getting the same issue in that the api.ai emulation is missing said fields in the response.
Does the api response from rasa include the parameters section? If so, I can't see any additional information the context section provides compared to the parameters.
@tmbo There is a parameters section that is returned (which is pretty empty) but it doesn't have any of the information that you would see in contexts.fulfilment (as an example) such as speech, messages etc
For comparison, here's my rasa api response:
{
"id": "95adf65c-52ab-11e7-a19a-0071cc0be9f7",
"result": {
"action": null,
"actionIncomplete": null,
"contexts": [],
"fulfillment": {},
"metadata": {
"intentId": "95aef4c6-52ab-11e7-a19a-0071cc0be9f7",
"intentName": {
"confidence": 1.1557425290596297,
"name": "User needs help"
},
"webhookUsed": "false"
},
"parameters": {
"help": [
"help"
]
},
"resolvedQuery": "help",
"score": null,
"source": "agent"
},
"sessionId": "95aef886-52ab-11e7-a19a-0071cc0be9f7",
"status": {
"code": 200,
"errorType": "success"
},
"timestamp": "2017-06-16T11:50:56.218173"
}
And here's my native api.ai response:
{
"id": "07b85a2f-b10f-453c-b664-674f0efe8915",
"timestamp": "2017-06-16T15:57:12.673Z",
"lang": "en",
"result": {
"source": "agent",
"resolvedQuery": "help",
"action": "help",
"actionIncomplete": false,
"parameters": {
"help": "help"
},
"contexts": [],
"metadata": {
"intentId": "eb4d359f-44e2-4524-958f-8d41827b1765",
"webhookUsed": "false",
"webhookForSlotFillingUsed": "false",
"intentName": "User needs help"
},
"fulfillment": {
"speech": "I can help you navigate this site, provide you with specific information or answer any questions you might have.",
"messages": [
{
"type": 0,
"speech": "I can help you navigate this site, provide you with specific information or answer any questions you might have."
}
]
},
"score": 1
},
"status": {
"code": 200,
"errorType": "success"
},
"sessionId": "ba2ffa12-c5f2-4695-a944-05ef7e510b99"
}
This is important for me too 鈥斅營 gathered from the Rasa website & various Youtube talks that it could work as a drop-in replacement for Dialogflow.
In my case most of the interesting stuff in my bot (Wagbot 鈥斅爓hich answers questions about school problems) is happening in the 'fulfilment' part of the Dialogflow responses. Only getting the intents and entities means I'd have to create some other system for delivering the dialogue responses.
Are there any plans to extend rasa_nlu to include that functionality?
Please take a look at Rasa Core or something like botkit. Rasa NLU is for NLU only: intents and entities. dialog/conversation/fulfillment are being built elsewhere.
Thanks @wrathagom 鈥斅爃aving a play with the Rasa Core tutorial now.
this is my fulfillment request
{
"responseId": "c98a4f41-2448-4d84-89c9-cfb5ee0820f4",
"queryResult": {
"queryText": "weather in hyderabad",
"action": "yahooWeatherForecast",
"parameters": {
"date": "",
"address": "",
"geo-city": [
"Hyderabad"
]
},
"allRequiredParamsPresent": true,
"intent": {
"name": "projects/weather-assistant-80b5e/agent/intents/38412c72-d166-45b2-9248-2b61ee64ae81",
"displayName": "Getweather"
},
"intentDetectionConfidence": 0.99,
"languageCode": "en"
},
"originalDetectIntentRequest": {
"payload": {}
},
"session": "projects/weather-assistant-80b5e/agent/sessions/4547dc9a-d90d-37d1-5704-5c9f5937b591"
}
this is my fulfillment response
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
i have hosted website on heroku.
now when i query in dialogflow say for example "weather in Hyderabad" at the server side i am getting an error that says request.get_json is null.
any help is appreciated thanks in advance
this my script that is running on server side
This is a closed issue, please open your own issue.
But looking at this, are you even using rasa? this sounds more like you are using dialogflow - so you should ask them for help.
Most helpful comment
Thanks @wrathagom 鈥斅爃aving a play with the Rasa Core tutorial now.