diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2025-11-19 18:38:25 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-05 09:14:02 +0000 |
| commit | 77200b36494dbf8f7aa1500fbf5976585fffdb66 (patch) | |
| tree | b3b17c991bf49a7ef78b297166d26427c808e66e /dashboard/dashapi | |
| parent | d65130ca2efd4a9ccb21068e3d9cefaf365e8dc6 (diff) | |
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
Diffstat (limited to 'dashboard/dashapi')
| -rw-r--r-- | dashboard/dashapi/ai.go | 53 |
1 files changed, 53 insertions, 0 deletions
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) +} |
