tgalice.interfaces.yandex.request.Request.from_dict

Here are the examples of the python api tgalice.interfaces.yandex.request.Request.from_dict taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : test_request.py
with GNU General Public License v3.0
from avidale

def test_intents():
    raw_req = {
        "command": "включи свет на кухне, пожалуйста",
        "nlu": {
            "intents": {
                "turn.on": {
                    "slots": {
                        "what": {
                            "type": "YANDEX.STRING",
                            "value": "свет"
                        },
                        "where": {
                            "type": "YANDEX.STRING",
                            "value": "на кухне"
                        }
                    }
                }
            }
        }
    }
    req = yandex.request.Request.from_dict(raw_req)
    assert "turn.on" in req.nlu.intents
    assert req.nlu.intents['turn.on'].slots['what'].type == "YANDEX.STRING"


def test_state_extraction():