From 7dcb97c1519b4374a3e37b236580345f4cc8336c Mon Sep 17 00:00:00 2001 From: saloui Date: Tue, 25 Jul 2023 16:49:43 +0200 Subject: [PATCH] upgraded personality --- lollms/personality.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lollms/personality.py b/lollms/personality.py index bbdd138..352e53d 100644 --- a/lollms/personality.py +++ b/lollms/personality.py @@ -1083,6 +1083,22 @@ class APScript(StateMachine): ).strip() return self.bot_says + + def execute_command(self, command:dict): + """Executes a command + + Args: + command (dict): command information in form: + name: (command name) + value: (command value) + params: (command parameters) + """ + + if command["value"] in self.states_dict[self.current_state_id]["commands"]: + return self.states_dict[self.current_state_id]["commands"][command["value"]](command) + else: + return False + def run_workflow(self, prompt:str, previous_discussion_text:str="", callback=None): """ Runs the workflow for processing the model input and output.