upgraded endpoint

This commit is contained in:
Saifeddine ALOUI 2025-02-20 00:53:53 +01:00
parent 3fa30ab47e
commit 60cd1c2870

View File

@ -132,7 +132,10 @@ async def mount_function_call(request: Request):
raise HTTPException(status_code=403, detail="Access denied")
# Validate function exists
fn_dir = lollmsElfServer.lollms_paths.functions_zoo_path / function_category / function_name
if function_category!="custom":
fn_dir = lollmsElfServer.lollms_paths.functions_zoo_path / function_category / function_name
else:
fn_dir = lollmsElfServer.lollms_paths.custom_function_calls_path / function_name
if not fn_dir.exists() or not (fn_dir / "config.yaml").exists() or not (fn_dir / "function.py").exists():
raise HTTPException(status_code=404, detail="Function not found")