2019-02-10 15:26:50 +03:00
|
|
|
#!/usr/bin/env python
|
|
|
|
# -*- coding:utf-8 -*-
|
|
|
|
|
|
|
|
import utils
|
|
|
|
from sys import argv, path
|
2019-03-02 07:54:25 +03:00
|
|
|
from json import dumps, loads
|
2019-02-10 15:26:50 +03:00
|
|
|
from importlib import import_module
|
|
|
|
|
|
|
|
def main():
|
2022-02-14 18:06:37 +03:00
|
|
|
"""Dynamically import skills related to the args and print the output"""
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
path.append('.')
|
|
|
|
|
2022-02-10 16:47:43 +03:00
|
|
|
intent_obj = utils.get_intent_obj()
|
2022-02-20 14:25:08 +03:00
|
|
|
|
2022-02-14 18:06:37 +03:00
|
|
|
skill = import_module('skills.' + intent_obj['domain'] + '.' + intent_obj['skill'] + '.src.actions.' + intent_obj['action'])
|
2019-02-10 15:26:50 +03:00
|
|
|
|
2022-02-14 18:06:37 +03:00
|
|
|
return getattr(skill, intent_obj['action'])(intent_obj['utterance'], intent_obj['entities'])
|
2019-02-10 15:26:50 +03:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|