Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API missing tracker return data if first event isn't a post to webhook #5032

Closed
samscudder opened this issue Jan 2, 2020 · 4 comments
Closed
Assignees
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.

Comments

@samscudder
Copy link

samscudder commented Jan 2, 2020

Rasa version: 1.6.0

Rasa SDK version (if used & relevant): 1.6.0

Rasa X version (if used & relevant):

Python version: Python 3.6.9 (Anaconda)

Operating system (windows, osx, ...): RHEL 7 (CentOS)

Issue: The tracker API isn't returning all the data if the first event isn't a post to webhook.

Error (including full traceback):

Missing information in return data (see below)


Command or request that led to error:
Clear history from mongoDB:

$ mongo
> use rasa
> db.dropDatabase()
> exit

Started RASA with:

$  rasa run --endpoints endpoints.yml --enable-api --debug

Posted a slot value to tracker, using postman (my sender id is "tester"):

POST to localhost:5005/conversations/tester/tracker/events
Post body: { "event": "slot", "name": "profile", "value": "corretor" }
Headers: { content-type: application/json }
Got a http 200 back with the following body:

{
    "sender_id": "tester",
    "slots": {
        "profile": "corretor",
    },
    "latest_message": {
        "intent": {},
        "entities": [],
        "text": null,
        "message_id": null,
        "metadata": {}
    },
    "latest_event_time": 1577995229.9281511307,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "action",
            "timestamp": 1577995229.9356689453,
            "name": "action_session_start",
            "policy": null,
            "confidence": null
        },
        {
            "event": "session_started",
            "timestamp": 1577995229.9356927872
        },
        {
            "event": "action",
            "timestamp": 1577995229.9357538223,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "slot",
            "timestamp": 1577995229.9281511307,
            "name": "profile",
            "value": "corretor"
        }
    ],
    "latest_input_channel": null,
    "active_form": {},
    "latest_action_name": "action_listen"
}

Then I posted a message to the tracker (with postman):

POST to localhost:5005/webhooks/rest/webhook
Post body: { "sender":"tester", "message":"Hi"}
Headers: { content-type: application/json }
Got a http 200 back.

I then called the tracker (with postman)

GET : localhost:5005/conversations/tester/tracker

{
    "sender_id": "tester",
    "slots": {
        "comentario_chamado": null,
        "descricao": null,
        "motivo_cancelamento": null,
        "numero_chamado": null,
        "profile": "corretor",
        "requested_slot": null,
        "titulo_chamado": null,
        "user_name": null
    },
    "latest_message": {
        "intent": {},
        "entities": [],
        "text": null,
        "message_id": null,
        "metadata": {}
    },
    "latest_event_time": 1577995389.7144963741,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "session_started",
            "timestamp": 1577995229.9356927872
        },
        {
            "event": "action",
            "timestamp": 1577995229.9357538223,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "slot",
            "timestamp": 1577995229.9281511307,
            "name": "profile",
            "value": "corretor"
        },
        {
            "event": "action",
            "timestamp": 1577995389.7108175755,
            "name": "utter_default",
            "policy": "policy_4_FallbackPolicy",
            "confidence": 0.7
        },
        {
            "event": "bot",
            "timestamp": 1577995389.7108221054,
            "text": "Não entendi, poderia reformular a frase?",
            "data": {
                "elements": null,
                "quick_replies": null,
                "buttons": null,
                "attachment": null,
                "image": null,
                "custom": null
            },
            "metadata": {}
        },
        {
            "event": "action",
            "timestamp": 1577995389.7144963741,
            "name": "action_listen",
            "policy": "policy_4_FallbackPolicy",
            "confidence": 1
        }
    ],
    "latest_input_channel": null,
    "active_form": {},
    "latest_action_name": "action_listen"
}

All the latest-message information is missing. Compare this to the following response if I post to webhook first (I dropped the mongo database again before posting this):

{
    "sender_id": "tester",
    "slots": {
        "comentario_chamado": null,
        "descricao": null,
        "motivo_cancelamento": null,
        "numero_chamado": null,
        "profile": null,
        "requested_slot": null,
        "titulo_chamado": null,
        "user_name": null
    },
    "latest_message": {
        "intent": {
            "name": "saudacao",
            "confidence": 0.9568712711
        },
        "entities": [],
        "intent_ranking": [
            {
                "name": "saudacao",
                "confidence": 0.9568712711
            },
            {
                "name": "agradecimento",
                "confidence": 0.0076029999
            },
            {
                "name": "suporte_valor_iptu",
                "confidence": 0.0046949848
            },
            {
                "name": "suporte_reembolso_plano",
                "confidence": 0.0039048197
            },
            {
                "name": "suporte_definicao_imovel_oportunidade",
                "confidence": 0.0034865651
            },
            {
                "name": "tratativa_adicionar_novidade_chamado",
                "confidence": 0.0020944814
            },
            {
                "name": "suporte_como_busco_imovel",
                "confidence": 0.0020385382
            },
            {
                "name": "suporte_definicao_gestor_placa",
                "confidence": 0.0017496475
            },
            {
                "name": "suporte_renovar_anuncio_gratis_vencido",
                "confidence": 0.0016969149
            },
            {
                "name": "suporte_visualiza_pedidos",
                "confidence": 0.0016599172
            }
        ],
        "text": "Oi"
    },
    "latest_event_time": 1577995607.2278442383,
    "followup_action": null,
    "paused": false,
    "events": [
        {
            "event": "session_started",
            "timestamp": 1577995607.2018072605
        },
        {
            "event": "action",
            "timestamp": 1577995607.2018611431,
            "name": "action_listen",
            "policy": null,
            "confidence": null
        },
        {
            "event": "user",
            "timestamp": 1577995607.2158670425,
            "text": "Hi",
            "parse_data": {
                "intent": {
                    "name": "saudacao",
                    "confidence": 0.9568712711
                },
                "entities": [],
                "intent_ranking": [
                    {
                        "name": "saudacao",
                        "confidence": 0.9568712711
                    },
                    {
                        "name": "agradecimento",
                        "confidence": 0.0076029999
                    },
                    {
                        "name": "suporte_valor_iptu",
                        "confidence": 0.0046949848
                    },
                    {
                        "name": "suporte_reembolso_plano",
                        "confidence": 0.0039048197
                    },
                    {
                        "name": "suporte_definicao_imovel_oportunidade",
                        "confidence": 0.0034865651
                    },
                    {
                        "name": "tratativa_adicionar_novidade_chamado",
                        "confidence": 0.0020944814
                    },
                    {
                        "name": "suporte_como_busco_imovel",
                        "confidence": 0.0020385382
                    },
                    {
                        "name": "suporte_definicao_gestor_placa",
                        "confidence": 0.0017496475
                    },
                    {
                        "name": "suporte_renovar_anuncio_gratis_vencido",
                        "confidence": 0.0016969149
                    },
                    {
                        "name": "suporte_visualiza_pedidos",
                        "confidence": 0.0016599172
                    }
                ],
                "text": "Oi"
            },
            "input_channel": "rest",
            "message_id": "039e9bc5961e4522a8a9f79cdf283998",
            "metadata": {}
        },
        {
            "event": "action",
            "timestamp": 1577995607.2246797085,
            "name": "action_saudacao",
            "policy": "policy_1_AugmentedMemoizationPolicy",
            "confidence": 1
        },
        {
            "event": "action",
            "timestamp": 1577995607.2278442383,
            "name": "action_listen",
            "policy": "policy_1_AugmentedMemoizationPolicy",
            "confidence": 1
        }
    ],
    "latest_input_channel": "rest",
    "active_form": {},
    "latest_action_name": "action_listen"
}

This works correctly in Rasa 1.4.6

Content of configuration file (config.yml) (if relevant):

Content of domain file (domain.yml) (if relevant):

@samscudder samscudder added the type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors. label Jan 2, 2020
@samscudder samscudder changed the title Tracker API missing return data if first event isn't a post to webhook API missing tracker return data if first event isn't a post to webhook in Rasa 1.6.0 Jan 2, 2020
@samscudder samscudder changed the title API missing tracker return data if first event isn't a post to webhook in Rasa 1.6.0 API missing tracker return data if first event isn't a post to webhook Jan 2, 2020
@sara-tagger
Copy link
Collaborator

Thanks for the issue, @wochinge will get back to you about it soon!

You may find help in the docs and the forum, too 🤗

@wochinge
Copy link
Contributor

wochinge commented Jan 3, 2020

Hi @samscudder ,

thanks for bringing this up. I can reproduce it with mongo and sqlite (not with the InmemoryTrackerStore though.

@wochinge wochinge added the area:rasa-oss 🎡 Anything related to the open source Rasa framework label Jan 3, 2020
@wochinge wochinge self-assigned this Jan 3, 2020
@wochinge wochinge mentioned this issue Jan 3, 2020
4 tasks
@federicotdn
Copy link
Contributor

federicotdn commented Jan 23, 2020

@wochinge should we close this issue? The PR for it was merged.

@wochinge
Copy link
Contributor

Omh, github should really close this when I do a fix ... comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:rasa-oss 🎡 Anything related to the open source Rasa framework type:bug 🐛 Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

No branches or pull requests

4 participants