diff options
Diffstat (limited to 'dashboard/dashapi/ai.go')
| -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) +} |
