This commit is contained in:
Saifeddine ALOUI 2025-03-08 23:36:33 +01:00
parent bd879d2605
commit cf4b66db4d
2 changed files with 14 additions and 1 deletions

View File

@ -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 = [

View File

@ -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.