コード例 #1
0
ファイル: events_test.py プロジェクト: udit-pandey/kairon
 async def _read_and_get_data(path: str):
     domain_path = os.path.join(path, DEFAULT_DOMAIN_PATH)
     training_data_path = os.path.join(path, DEFAULT_DATA_PATH)
     config_path = os.path.join(path, DEFAULT_CONFIG_PATH)
     http_actions_path = os.path.join(path, 'actions.yml')
     importer = RasaFileImporter.load_from_config(config_path=config_path,
                                                  domain_path=domain_path,
                                                  training_data_paths=training_data_path)
     domain = await importer.get_domain()
     story_graph = await importer.get_stories()
     config = await importer.get_config()
     nlu = await importer.get_nlu_data(config.get('language'))
     http_actions = Utility.read_yaml(http_actions_path)
     return nlu, story_graph, domain, config, http_actions
コード例 #2
0
ファイル: events_test.py プロジェクト: udit-pandey/kairon
        async def _read_and_get_data(config_path: str, domain_path: str, nlu_path: str, stories_path: str, bot: str, user: str):
            data_path = os.path.join(pytest.tmp_dir, str(uuid.uuid4()))
            os.mkdir(data_path)
            shutil.copy2(nlu_path, data_path)
            shutil.copy2(stories_path, data_path)
            importer = RasaFileImporter.load_from_config(config_path=config_path,
                                                         domain_path=domain_path,
                                                         training_data_paths=data_path)
            domain = await importer.get_domain()
            story_graph = await importer.get_stories()
            config = await importer.get_config()
            nlu = await importer.get_nlu_data(config.get('language'))

            processor = MongoProcessor()
            processor.save_training_data(bot, user, config, domain, story_graph, nlu, overwrite=True)