From a45d9502dbc1c37176607347409502144c75ae16 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 29 Nov 2025 22:35:33 +0100 Subject: [PATCH 1/2] feat(agent-jobs): add multimedia support Signed-off-by: Ettore Di Giacinto --- core/http/endpoints/localai/agent_jobs.go | 25 +- core/http/views/agent-jobs.html | 145 +++++++++- core/http/views/agent-task-details.html | 257 +++++++++++++++++- core/http/views/backends.html | 5 +- core/http/views/chat.html | 5 +- core/http/views/models.html | 5 +- core/http/views/text2image.html | 5 +- core/schema/agent_jobs.go | 25 ++ core/services/agent_jobs.go | 206 +++++++++++++- core/services/agent_jobs_test.go | 316 +++++++++++++++++++++- 10 files changed, 949 insertions(+), 45 deletions(-) diff --git a/core/http/endpoints/localai/agent_jobs.go b/core/http/endpoints/localai/agent_jobs.go index 0e65a241df4b..267547434950 100644 --- a/core/http/endpoints/localai/agent_jobs.go +++ b/core/http/endpoints/localai/agent_jobs.go @@ -147,7 +147,28 @@ func ExecuteJobEndpoint(app *application.Application) echo.HandlerFunc { req.Parameters = make(map[string]string) } - jobID, err := app.AgentJobService().ExecuteJob(req.TaskID, req.Parameters, "api") + // Build multimedia struct from request + var multimedia *struct { + Images []string + Videos []string + Audios []string + Files []string + } + if len(req.Images) > 0 || len(req.Videos) > 0 || len(req.Audios) > 0 || len(req.Files) > 0 { + multimedia = &struct { + Images []string + Videos []string + Audios []string + Files []string + }{ + Images: req.Images, + Videos: req.Videos, + Audios: req.Audios, + Files: req.Files, + } + } + + jobID, err := app.AgentJobService().ExecuteJob(req.TaskID, req.Parameters, "api", multimedia) if err != nil { return c.JSON(http.StatusBadRequest, map[string]string{"error": err.Error()}) } @@ -323,7 +344,7 @@ func ExecuteTaskByNameEndpoint(app *application.Application) echo.HandlerFunc { return c.JSON(http.StatusNotFound, map[string]string{"error": "Task not found: " + name}) } - jobID, err := app.AgentJobService().ExecuteJob(task.ID, params, "api") + jobID, err := app.AgentJobService().ExecuteJob(task.ID, params, "api", nil) if err != nil { return c.JSON(http.StatusBadRequest, map[string]string{"error": err.Error()}) } diff --git a/core/http/views/agent-jobs.html b/core/http/views/agent-jobs.html index b650e1a4ccf7..a439f6bd2333 100644 --- a/core/http/views/agent-jobs.html +++ b/core/http/views/agent-jobs.html @@ -365,21 +365,40 @@

Job History< x-cloak @click.away="showExecuteTaskModal = false; selectedTaskForExecution = null; executionParameters = {}; executionParametersText = ''" class="fixed inset-0 bg-black/50 flex items-center justify-center z-50"> -
-
+
+

Execute Task

-