From e769ffc14521e471032a588adf41d15ec168f1cf Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Tue, 25 Feb 2025 22:08:19 +0100 Subject: [PATCH] added unmount all --- lollms/server/endpoints/lollms_function_calls.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lollms/server/endpoints/lollms_function_calls.py b/lollms/server/endpoints/lollms_function_calls.py index 54d6308..59d793d 100644 --- a/lollms/server/endpoints/lollms_function_calls.py +++ b/lollms/server/endpoints/lollms_function_calls.py @@ -180,6 +180,21 @@ async def unmount_function_call(request: Request): lollmsElfServer.config.save_config() return {"status": True, "message": "Function unmounted successfully"} +@router.post("/unmount_all_functions") +async def unmount_all_functions(request: Request): + """Unmount a function call to remove it from LLM's availability""" + data = await request.json() + client_id = data.get("client_id") + + if not check_access(lollmsElfServer, client_id): + raise HTTPException(status_code=403, detail="Access denied") + + # Find and update the function call + found = False + lollmsElfServer.config.mounted_function_calls=[] + + lollmsElfServer.config.save_config() + return {"status": True, "message": "Function unmounted successfully"} @router.post("/toggle_function_call") async def toggle_function_call(request: Request):