From cf4b66db4de0d6cbf1ff096a41b1c4d281d45a87 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sat, 8 Mar 2025 23:36:33 +0100 Subject: [PATCH] upgraded --- lollms/app.py | 14 ++++++++++++++ lollms/tti.py | 1 - 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lollms/app.py b/lollms/app.py index 6a33a71..cf6b2cd 100644 --- a/lollms/app.py +++ b/lollms/app.py @@ -223,6 +223,20 @@ class LollmsApplication(LoLLMsCom): self.error("Couldn't add function call to context") trace_exception(ex) return None + + def execute_function(self, code, client): + function_call=json.loads(code) + name = function_call["function_name"] + for fc in self.config.mounted_function_calls: + if fc["selected"]: + if fc["name"] == name: + fci = self.load_function_call(fc, client) + if fci: + output = fci["class"].execute(LollmsContextDetails(client),**function_call["function_parameters"]) + return output + + + def embed_function_call_in_prompt(self, original_prompt): """Embeds function call descriptions in the system prompt""" function_descriptions = [ diff --git a/lollms/tti.py b/lollms/tti.py index f1d44a3..23af056 100644 --- a/lollms/tti.py +++ b/lollms/tti.py @@ -46,7 +46,6 @@ class LollmsTTI(LollmsSERVICE): negative_prompt: str = "", width=512, height=512, - generation_engine=None, output_path = None) -> List[Dict[str, str]]: """ Generates images based on the given positive and negative prompts.