Beispiel #1
0
 def delete_channel_config(connector_type: Text, bot: Text):
     """
     Delete a particular channel configuration for bot
     :param connector_type: channel name
     :param bot: bot id
     :return: None
     """
     Utility.hard_delete_document([Channels],
                                  bot=bot,
                                  connector_type=connector_type)
Beispiel #2
0
    def delete_bot(bot: Text):
        from kairon.shared.data.data_objects import Intents, Responses, Stories, Configs, Endpoints, Entities, \
            EntitySynonyms, Forms, LookupTables, ModelDeployment, ModelTraining, RegexFeatures, Rules, SessionConfigs, \
            Slots, TrainingDataGenerator, TrainingExamples
        from kairon.shared.test.data_objects import ModelTestingLogs
        from kairon.shared.importer.data_objects import ValidationLogs
        from kairon.shared.actions.data_objects import HttpActionConfig, ActionServerLogs, Actions

        try:
            bot_info = Bot.objects(id=bot, status=True).get()
            bot_info.status = False
            bot_info.save()
            Utility.hard_delete_document([
                Actions, BotAccess, BotSettings, Configs, ChatClientConfig,
                Endpoints, Entities, EmailActionConfig, EntitySynonyms, Forms,
                FormValidationAction, HttpActionConfig, Intents, LookupTables,
                RegexFeatures, Responses, Rules, SlotMapping, SlotSetAction,
                SessionConfigs, Slots, Stories, TrainingDataGenerator,
                TrainingExamples, ActionServerLogs, ModelTraining,
                ModelTestingLogs, ModelDeployment, ValidationLogs
            ], bot)
            AccountProcessor.remove_bot_access(bot)
        except DoesNotExist:
            raise AppException('Bot not found')