Rasa version: 1.10.0
Rasa X version (if used & relevant): 0.29.1
Python version: 2.7.17
Operating system (windows, osx, ...): linux, docker
Issue:
Slots that are defined in domain.yml with an initial_value are not included within the tracker information that can be received using the HTTP API (https://api/conversations/{conversation_id}/tracker)
Error (including full traceback):
Command or request that led to error:
https://api/conversations/{conversation_id}/tracker
Content of domain file (domain.yml) (if relevant):
location:
type: unfeaturized
initial_value: Hamburg
@leondroidgeeks you can retrieve the domain using GET /domain. Does that address your issue?
Using GET /domain I can see the preset slot value, that's true. But it doesn't really address the issue since the preset value is still not included in the tracker output (using GET /conversations/{conversation_id}/tracker) as well. Only after the slot is set through an utterance by the user it appears in the tracker. I think this is an inconsistent behavior since the tracker should show all slots that are taken into account during an interaction with the user.
@leondroidgeeks the slots listed under slots in the serialised tracker are only those that have been set during a conversation. they correspond to SlotSet events that actually took place.
Can you say a little more about your use case and why you think slots with an initial value should be included from the get-go?
Okay, that makes sense. I would like to show the user all the slots that are currently set since they influence the conversation flow. This also includes slot that are initially set and not only overwritten by the user.
Slots that are set by custom actions are like initial slots not set by the user itself but by the system. Yet they are included in the tracker (i guess). So I think to be consistent, initially set slots should be included in the tracker as well.
@leondroidgeeks could you post the output of what you get back from the tracker endpoint?
Sorry for the confusion, but @ricwo and I just discussed this and actually the slots you have set inital values for will be part of the response from the /tracker endpoint, under the slots: key.
Are you asking why they're not part of the events listed in the tracker?
Mmmh then I will have a second look at this because as I remember, I couldn't find my preset slot under the slots key in the response I get from the /tracker endpoint. (I am interested in the slots key, not the events)
Currently I have some troubles with my Rasa Server (I just posted in the forum about this), but I will get to it when I can talk to bot again!
alright sounds good! I'm going to close this for now, since we can't reproduce it, but if it happens again feel free to re-open.
Also something I just noticed in your initial description of the issue: you're running python 2.7, which is actually not supported anymore
My bot talks again and I could check the tracker.
The slot section of my domain file looks like the following:
slots:
icecream_type:
type: unfeaturized
location:
type: unfeaturized
initial_value: Hamburg
number:
type: unfeaturized
pizza_type:
type: list
requested_slot:
type: unfeaturized
After I (as a user) write my bot 'Hi' triggering utter_greeting and utter_ask_assistance my tracker output is the following:
{
"sender_id": "leonaslkdfjaskljf",
"slots": {},
"latest_message": {
"intent": {
"name": "greeting",
"confidence": 0.9989657402
},
"entities": [],
"intent_ranking": [
{
"name": "greeting",
"confidence": 0.9989657402
},
{
"name": "order",
"confidence": 0.0003359609
},
{
"name": "thankyou",
"confidence": 0.0002148542
},
{
"name": "affirmation",
"confidence": 0.0001603587
},
{
"name": "help",
"confidence": 0.0001013637
},
{
"name": "order_pizza",
"confidence": 0.0000862446
},
{
"name": "wellbeing",
"confidence": 0.0000721303
},
{
"name": "order_overview",
"confidence": 0.0000246966
},
{
"name": "farewell",
"confidence": 0.0000215525
},
{
"name": "question_order_types",
"confidence": 0.0000171198
}
],
"response_selector": {
"default": {
"response": {
"name": null,
"confidence": 0.0
},
"ranking": [],
"full_retrieval_intent": null
}
},
"text": "Hi"
},
"latest_event_time": 1592397823.3118007183,
"followup_action": null,
"paused": false,
"events": [
{
"event": "action",
"timestamp": 1592397823.2715022564,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19484
},
"name": "action_session_start",
"policy": null,
"confidence": null,
"is_flagged": false
},
{
"event": "session_started",
"timestamp": 1592397823.2715120316,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19485
},
"is_flagged": false
},
{
"event": "action",
"timestamp": 1592397823.2715358734,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19486
},
"name": "action_listen",
"policy": null,
"confidence": null,
"is_flagged": false
},
{
"event": "user",
"timestamp": 1592397823.2983410358,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19487
},
"text": "Hi",
"parse_data": {
"intent": {
"name": "greeting",
"confidence": 0.9989657402
},
"entities": [],
"intent_ranking": [
{
"name": "greeting",
"confidence": 0.9989657402
},
{
"name": "order",
"confidence": 0.0003359609
},
{
"name": "thankyou",
"confidence": 0.0002148542
},
{
"name": "affirmation",
"confidence": 0.0001603587
},
{
"name": "help",
"confidence": 0.0001013637
},
{
"name": "order_pizza",
"confidence": 0.0000862446
},
{
"name": "wellbeing",
"confidence": 0.0000721303
},
{
"name": "order_overview",
"confidence": 0.0000246966
},
{
"name": "farewell",
"confidence": 0.0000215525
},
{
"name": "question_order_types",
"confidence": 0.0000171198
}
],
"response_selector": {
"default": {
"response": {
"name": null,
"confidence": 0.0
},
"ranking": [],
"full_retrieval_intent": null
}
},
"text": "Hi"
},
"input_channel": "rest",
"message_id": "7bed66372ceb4a23984620ed54eb47a6",
"is_flagged": false
},
{
"event": "action",
"timestamp": 1592397823.302554369,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19488
},
"name": "utter_greeting",
"policy": "policy_0_MemoizationPolicy",
"confidence": 1.0,
"is_flagged": false
},
{
"event": "bot",
"timestamp": 1592397823.3025634289,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19489
},
"text": "Guten Tag",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
},
"is_flagged": false
},
{
"event": "action",
"timestamp": 1592397823.307012558,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19490
},
"name": "utter_ask_assistance",
"policy": "policy_1_TEDPolicy",
"confidence": 0.7805805206,
"is_flagged": false
},
{
"event": "bot",
"timestamp": 1592397823.3070237637,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19491
},
"text": "Wie kann ich dir weiterhelfen?",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
},
"is_flagged": false
},
{
"event": "action",
"timestamp": 1592397823.3118007183,
"metadata": {
"rasa_x_flagged": false,
"rasa_x_id": 19492
},
"name": "action_listen",
"policy": "policy_0_MemoizationPolicy",
"confidence": 1.0,
"is_flagged": false
}
],
"latest_input_channel": "rest",
"active_form": {},
"latest_action_name": "action_listen"
}
Did you retrain the bot since adding that to the domain?
Oh, are you querying the Rasa X API btw? Or the Rasa Open Source one?
Yes, I retrained the bot. I think I am querying the Rasa X API because it's the same endpoint like the Rasa X frontend? I deployed it using Docker Quick Install so I don't exactly know how to query the Rasa Open Source API
hm ok maybe it's an issue with the way that API returns things then. Can you try sending the same request to /core/conversations/conversation_id/tracker?
So you mean instead of sending it to GET /api/conversations/{conversation_id}/tracker (which i did yesterday) i should send it to GET /core/conversations/{conversation_id}/tracker.
When I call the /core API i get a Server Error
<h1>Internal Server Error</h1>
<p>
The server encountered an internal error and cannot complete
your request.
</p>
Sorry there's some bad error handling on our part there... we're gonna fix that. But yes, I meant send a request to that endpoint. To get an actual response though, you'll need to add something to the end of the url:
GET /core/conversations/{conversation_id}/tracker?token={RASA_TOKEN} and the RASA_TOKEN you can get from your .env file where you have Rasa X deployed.
That works very well for me! You can see the output below.
So the GET /core endpoint using the RASA_TOKEN calls the Rasa Open Source APIs?
Is there any other difference between these two APIs for getting the tracker?
{
"sender_id": "leonaslkdfjasklj",
"slots": {
"icecream_type": null,
"location": "Hamburg",
"number": null,
"pizza_type": null,
"requested_slot": null
},
"latest_message": {
"intent": {
"name": "greeting",
"confidence": 0.9996652007102966
},
"entities": [],
"intent_ranking": [
{
"name": "greeting",
"confidence": 0.9996652007102966
},
{
"name": "question_order_types",
"confidence": 0.0001154456622316502
},
{
"name": "order",
"confidence": 0.0000755277942516841
},
{
"name": "farewell",
"confidence": 0.00004171537875663489
},
{
"name": "order_overview",
"confidence": 0.00003368206671439111
},
{
"name": "affirmation",
"confidence": 0.000020257470168871805
},
{
"name": "function",
"confidence": 0.000018446291505824775
},
{
"name": "order_pizza",
"confidence": 0.000014638449101767037
},
{
"name": "out_of_scope",
"confidence": 0.000008117904144455679
},
{
"name": "wellbeing",
"confidence": 0.000007037477189442143
}
],
"response_selector": {
"default": {
"response": {
"name": null,
"confidence": 0.0
},
"ranking": [],
"full_retrieval_intent": null
}
},
"text": "Hi"
},
"latest_event_time": 1592579979.664823,
"followup_action": null,
"paused": false,
"events": [
{
"event": "session_started",
"timestamp": 1592579979.6270561
},
{
"event": "action",
"timestamp": 1592579979.627083,
"name": "action_listen",
"policy": null,
"confidence": null
},
{
"event": "user",
"timestamp": 1592579979.6533604,
"text": "Hi",
"parse_data": {
"intent": {
"name": "greeting",
"confidence": 0.9996652007102966
},
"entities": [],
"intent_ranking": [
{
"name": "greeting",
"confidence": 0.9996652007102966
},
{
"name": "question_order_types",
"confidence": 0.0001154456622316502
},
{
"name": "order",
"confidence": 0.0000755277942516841
},
{
"name": "farewell",
"confidence": 0.00004171537875663489
},
{
"name": "order_overview",
"confidence": 0.00003368206671439111
},
{
"name": "affirmation",
"confidence": 0.000020257470168871805
},
{
"name": "function",
"confidence": 0.000018446291505824775
},
{
"name": "order_pizza",
"confidence": 0.000014638449101767037
},
{
"name": "out_of_scope",
"confidence": 0.000008117904144455679
},
{
"name": "wellbeing",
"confidence": 0.000007037477189442143
}
],
"response_selector": {
"default": {
"response": {
"name": null,
"confidence": 0.0
},
"ranking": [],
"full_retrieval_intent": null
}
},
"text": "Hi"
},
"input_channel": "rest",
"message_id": "5f90bcb6205f412f82765a99584c008f",
"metadata": {}
},
{
"event": "action",
"timestamp": 1592579979.6575055,
"name": "utter_greeting",
"policy": "policy_0_MemoizationPolicy",
"confidence": 1.0
},
{
"event": "bot",
"timestamp": 1592579979.6575148,
"text": "Guten Tag",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
},
"metadata": {}
},
{
"event": "action",
"timestamp": 1592579979.6615345,
"name": "utter_ask_assistance",
"policy": "policy_1_TEDPolicy",
"confidence": 0.7362150549888611
},
{
"event": "bot",
"timestamp": 1592579979.6615422,
"text": "Wie kann ich dir weiterhelfen?",
"data": {
"elements": null,
"quick_replies": null,
"buttons": null,
"attachment": null,
"image": null,
"custom": null
},
"metadata": {}
},
{
"event": "action",
"timestamp": 1592579979.664823,
"name": "action_listen",
"policy": "policy_0_MemoizationPolicy",
"confidence": 1.0
}
],
"latest_input_channel": "rest",
"active_form": {},
"latest_action_name": "action_listen"
}
ok this is odd! I will check in with the team as to what may be going on here
@leondroidgeeks thanks a lot for your input. the slots values in the tracker are inconsistent between the two APIs, and we'll look into fixing that. In the meantime, would querying /core/ directly be an option for you?
So the GET /core endpoint using the RASA_TOKEN calls the Rasa Open Source APIs?
yes that's right, it queries Rasa Open Source directly
Is there any other difference between these two APIs for getting the tracker?
There could be a few other differences - we'll look into getting the two tracker endpoints aligned as much as possible
@ricwo great thank you very much. Switching to the /core API is no problem for me
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.