1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-28 03:02:53 +03:00
leon/bridges/python/main.py

22 lines
554 B
Python
Raw Normal View History

2019-02-10 15:26:50 +03:00
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from sys import argv, path
from json import dumps, loads
2019-02-10 15:26:50 +03:00
from importlib import import_module
def main():
"""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()
skill = import_module('skills.' + intent_obj['domain'] + '.' + intent_obj['skill'] + '.src.actions.' + intent_obj['action'])
2019-02-10 15:26:50 +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()