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

22 lines
548 B
Python

#!/usr/bin/env python
# -*- coding:utf-8 -*-
import utils
from sys import path
from json import dumps, loads
from importlib import import_module
def main():
"""Dynamically import skills related to the args and print the output"""
path.append('.')
intent_obj = utils.get_intent_obj()
skill = import_module('skills.' + intent_obj['domain'] + '.' + intent_obj['skill'] + '.src.actions.' + intent_obj['action'])
return getattr(skill, intent_obj['action'])(intent_obj['utterance'], intent_obj['entities'])
if __name__ == '__main__':
main()