def test_write_training_data_with_rules(self): from kairon.data_processor.processor import MongoProcessor processor = MongoProcessor() training_data = processor.load_nlu("test_load_from_path_yml_training_files") story_graph = processor.load_stories("test_load_from_path_yml_training_files") domain = processor.load_domain("test_load_from_path_yml_training_files") config = processor.load_config("test_load_from_path_yml_training_files") http_action = processor.load_http_action("test_load_from_path_yml_training_files") rules = processor.get_rules_for_training("test_load_from_path_yml_training_files") training_data_path = Utility.write_training_data(training_data, domain, config, story_graph, rules, http_action) assert os.path.exists(training_data_path)
async def test_write_training_data(self): from kairon.data_processor.processor import MongoProcessor processor = MongoProcessor() await ( processor.save_from_path( "./tests/testing_data/yml_training_files", bot="test_load_from_path_yml_training_files", user="******" ) ) training_data = processor.load_nlu("test_load_from_path_yml_training_files") story_graph = processor.load_stories("test_load_from_path_yml_training_files") domain = processor.load_domain("test_load_from_path_yml_training_files") config = processor.load_config("test_load_from_path_yml_training_files") http_action = processor.load_http_action("test_load_from_path_yml_training_files") training_data_path = Utility.write_training_data(training_data, domain, config, story_graph, None, http_action) assert os.path.exists(training_data_path)