From 77200b36494dbf8f7aa1500fbf5976585fffdb66 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 19 Nov 2025 18:38:25 +0100 Subject: dashboard/app: add support for AI workflows Support for: - polling for AI jobs - handling completion of AI jobs - submitting job trajectory logs - basic visualization for AI jobs --- dashboard/dashapi/ai.go | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 dashboard/dashapi/ai.go (limited to 'dashboard/dashapi') diff --git a/dashboard/dashapi/ai.go b/dashboard/dashapi/ai.go new file mode 100644 index 000000000..893ed7215 --- /dev/null +++ b/dashboard/dashapi/ai.go @@ -0,0 +1,53 @@ +// Copyright 2025 syzkaller project authors. All rights reserved. +// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +package dashapi + +import ( + "github.com/google/syzkaller/pkg/aflow/ai" + "github.com/google/syzkaller/pkg/aflow/trajectory" +) + +type AIJobPollReq struct { + LLMModel string // LLM model that will be used to execute jobs + CodeRevision string // git commit of the syz-agent server + Workflows []AIWorkflow +} + +type AIWorkflow struct { + Type ai.WorkflowType + Name string +} + +type AIJobPollResp struct { + ID string + Workflow string + Args map[string]any +} + +type AIJobDoneReq struct { + ID string + Error string + Results map[string]any +} + +type AITrajectoryReq struct { + JobID string + Span *trajectory.Span +} + +func (dash *Dashboard) AIJobPoll(req *AIJobPollReq) (*AIJobPollResp, error) { + resp := new(AIJobPollResp) + if err := dash.Query("ai_job_poll", req, resp); err != nil { + return nil, err + } + return resp, nil +} + +func (dash *Dashboard) AIJobDone(req *AIJobDoneReq) error { + return dash.Query("ai_job_done", req, nil) +} + +func (dash *Dashboard) AITrajectoryLog(req *AITrajectoryReq) error { + return dash.Query("ai_trajectory_log", req, nil) +} -- cgit mrf-deployment