Documentation
¶
Overview ¶
Package agentcontrol is the resource module for the AgentControl surface — fine-tuning jobs, model training, knowledge bases, datasets, server-side agents, and GitHub dataset import.
Every AgentControl request carries an X-Tenant-ID header. Set the tenant id once (via vxsdk.WithTenantID, LoadFromVxcli, or the Client's TenantID field) and it applies to every sub-resource call.
Endpoints (all on the per-tenant node):
GET /api/v2/agentcontrol/summary
GET /api/v2/agentcontrol/{fine-tuning,training,knowledge,datasets,agents}/
GET /api/v2/agentcontrol/{...}/{id}
POST /api/v2/agentcontrol/{fine-tuning,training,knowledge}/
GET /api/v2/agentcontrol/datasets/{id}/preview
POST /api/v2/agentcontrol/datasets/upload (multipart)
POST /api/v2/agentcontrol/agents/{id}/execute
GET /api/v2/agentcontrol/github/repos
POST /api/v2/agentcontrol/github/import-dataset
agentcontrol_new.go — sub-resources added to reach UI parity with the /api/v2/agentcontrol/* surface. The original agentcontrol.go covers FineTuning, Training, Knowledge, Datasets, Agents, GitHub and Summary; this file adds Embeddings, Tools, MCP, Evals, Code, Models, Deployments, WebAssets, Benchmarks, Catalog, Health, Events, LLM, DeployTargets, Workflows-shim and Infra. Conventions match the existing file: every sub-resource is a {*Client, path} struct; all I/O routes through Client.do / doList / doDelete / doBytes; validation uses requireKeys.
agentcontrol_verbs.go — verbs missing from the original agentcontrol.go sub-resources, plus a handful of agent-related routes (Get, Update, Delete, ProxyExecute, RuntimeMetrics) and dataset routes (Download, Delete) that don't fit either the "new sub-resource" file or the trimmed original.
Method receivers reuse the existing sub-resource types from agentcontrol.go so the public API stays one struct per resource. Routes mirror what the UI's agentcontrol_service.ts calls — see [c:/tmp/agentcontrol_ui_actions.md].
Index ¶
- type Agents
- func (r *Agents) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Agents) Delete(ctx context.Context, agentID string) (Result, error)
- func (r *Agents) Execute(ctx context.Context, agentID, task string, extra map[string]interface{}) (Result, error)
- func (r *Agents) Get(ctx context.Context, agentID string) (Result, error)
- func (r *Agents) List(ctx context.Context) ([]Result, error)
- func (r *Agents) ProxyExecute(ctx context.Context, in ProxyExecuteInput) (Result, error)
- func (r *Agents) Update(ctx context.Context, agentID string, patch map[string]interface{}) (Result, error)
- type Benchmarks
- type Catalog
- type ChatRequest
- type Client
- func (c *Client) Agents() *Agents
- func (c *Client) Benchmarks() *Benchmarks
- func (c *Client) Catalog() *Catalog
- func (c *Client) Code() *Code
- func (c *Client) Datasets() *Datasets
- func (c *Client) DeployTargets() *DeployTargets
- func (c *Client) Deployments() *Deployments
- func (c *Client) Embeddings() *Embeddings
- func (c *Client) Evals() *Evals
- func (c *Client) Events() *Events
- func (c *Client) FineTuning() *FineTuning
- func (c *Client) GitHub() *GitHub
- func (c *Client) Health() *Health
- func (c *Client) Infra() *Infra
- func (c *Client) Knowledge() *Knowledge
- func (c *Client) LLM() *LLM
- func (c *Client) MCP() *MCP
- func (c *Client) Models() *Models
- func (c *Client) RuntimeMetrics(ctx context.Context, endpoint string) (Result, error)
- func (c *Client) Summary(ctx context.Context) (Result, error)
- func (c *Client) Tools() *Tools
- func (c *Client) Training() *Training
- func (c *Client) WebAssets() *WebAssets
- func (c *Client) Workflows() *Workflows
- type Code
- func (r *Code) DeleteSaved(ctx context.Context, filename string) (Result, error)
- func (r *Code) GetSaved(ctx context.Context, filename string) (Result, error)
- func (r *Code) ListSaved(ctx context.Context) (Result, error)
- func (r *Code) Run(ctx context.Context, opts RunOptions) (Result, error)
- func (r *Code) Save(ctx context.Context, filename, language, content string) (Result, error)
- type Datasets
- func (r *Datasets) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Datasets) Delete(ctx context.Context, id string) (Result, error)
- func (r *Datasets) Download(ctx context.Context, id string) ([]byte, error)
- func (r *Datasets) Get(ctx context.Context, datasetID string) (Result, error)
- func (r *Datasets) List(ctx context.Context) ([]Result, error)
- func (r *Datasets) Preview(ctx context.Context, datasetID string) (Result, error)
- func (r *Datasets) Upload(ctx context.Context, content []byte, filename string, opts UploadOptions) (Result, error)
- type DeployTargets
- type Deployments
- func (r *Deployments) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Deployments) Delete(ctx context.Context, id string) (Result, error)
- func (r *Deployments) DeleteAll(ctx context.Context) (Result, error)
- func (r *Deployments) List(ctx context.Context) ([]Result, error)
- func (r *Deployments) SetStatus(ctx context.Context, id, status string) (Result, error)
- func (r *Deployments) Summary(ctx context.Context) (Result, error)
- func (r *Deployments) Sync(ctx context.Context, id string) (Result, error)
- type Embeddings
- func (r *Embeddings) Delete(ctx context.Context, id string) (Result, error)
- func (r *Embeddings) DeleteAll(ctx context.Context) (Result, error)
- func (r *Embeddings) Download(ctx context.Context, id, part string) ([]byte, error)
- func (r *Embeddings) List(ctx context.Context) ([]Result, error)
- func (r *Embeddings) Promote(ctx context.Context, id string) (Result, error)
- func (r *Embeddings) Query(ctx context.Context, id, question string, topK int) (Result, error)
- func (r *Embeddings) Upload(ctx context.Context, filename, contentBase64 string) (Result, error)
- func (r *Embeddings) Visualize(ctx context.Context, id string, maxPoints int) (Result, error)
- type Evals
- func (r *Evals) CreateRun(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Evals) DeleteRun(ctx context.Context, id string) (Result, error)
- func (r *Evals) FeedbackStats(ctx context.Context) (Result, error)
- func (r *Evals) ListRuns(ctx context.Context) ([]Result, error)
- func (r *Evals) SubmitFeedback(ctx context.Context, requestID, feedback, comment string) (Result, error)
- type Events
- type FineTuning
- func (r *FineTuning) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *FineTuning) Delete(ctx context.Context, jobID string) (Result, error)
- func (r *FineTuning) DeleteAll(ctx context.Context) (Result, error)
- func (r *FineTuning) Get(ctx context.Context, jobID string) (Result, error)
- func (r *FineTuning) List(ctx context.Context) ([]Result, error)
- func (r *FineTuning) Wait(ctx context.Context, jobID string, opts WaitOptions) (Result, error)
- type GitHub
- type GitHubContentsInput
- type Health
- type ImportDatasetInput
- type Infra
- type Knowledge
- func (r *Knowledge) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Knowledge) Delete(ctx context.Context, kbID string) (Result, error)
- func (r *Knowledge) DeleteAll(ctx context.Context) (Result, error)
- func (r *Knowledge) Get(ctx context.Context, kbID string) (Result, error)
- func (r *Knowledge) List(ctx context.Context) ([]Result, error)
- func (r *Knowledge) Wait(ctx context.Context, kbID string, opts WaitOptions) (Result, error)
- type LLM
- type MCP
- type Models
- func (r *Models) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Models) Delete(ctx context.Context, id string) (Result, error)
- func (r *Models) DeleteAll(ctx context.Context) (Result, error)
- func (r *Models) ExportTrainingData(ctx context.Context, id string) (Result, error)
- func (r *Models) Get(ctx context.Context, id string) (Result, error)
- func (r *Models) List(ctx context.Context, state string) ([]Result, error)
- func (r *Models) SetState(ctx context.Context, id, state string) (Result, error)
- type ProvisionInput
- type ProxyExecuteInput
- type Result
- type RunOptions
- type Tools
- func (r *Tools) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Tools) Delete(ctx context.Context, id string) (Result, error)
- func (r *Tools) List(ctx context.Context) ([]Result, error)
- func (r *Tools) Update(ctx context.Context, id string, patch map[string]interface{}) (Result, error)
- type Training
- func (r *Training) Chat(ctx context.Context, jobID string, in TrainingChatRequest) (Result, error)
- func (r *Training) Clone(ctx context.Context, jobID string) (Result, error)
- func (r *Training) Create(ctx context.Context, spec map[string]interface{}) (Result, error)
- func (r *Training) Delete(ctx context.Context, jobID string) (Result, error)
- func (r *Training) DeleteAll(ctx context.Context, typeFilter string) (Result, error)
- func (r *Training) Export(ctx context.Context, jobID string) (Result, error)
- func (r *Training) Get(ctx context.Context, jobID string) (Result, error)
- func (r *Training) List(ctx context.Context) ([]Result, error)
- func (r *Training) Logs(ctx context.Context, jobID string) (Result, error)
- func (r *Training) Metrics(ctx context.Context, jobID string) (Result, error)
- func (r *Training) Restart(ctx context.Context, jobID string) (Result, error)
- func (r *Training) RunQA(ctx context.Context, jobID string) (Result, error)
- func (r *Training) RunTests(ctx context.Context, jobID string) (Result, error)
- func (r *Training) Update(ctx context.Context, jobID string, patch map[string]interface{}) (Result, error)
- func (r *Training) Wait(ctx context.Context, jobID string, opts WaitOptions) (Result, error)
- type TrainingChatRequest
- type UploadOptions
- type WaitOptions
- type WebAssets
- type Workflows
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agents ¶
type Agents struct {
// contains filtered or unexported fields
}
Agents is the server-side agents sub-resource.
func (*Agents) Create ¶
Create registers a new server-side agent. spec must include at least name and model_id.
func (*Agents) Execute ¶
func (r *Agents) Execute(ctx context.Context, agentID, task string, extra map[string]interface{}) (Result, error)
Execute runs a server-side agent against a task. extra fields, if any, are merged into the request body.
func (*Agents) ProxyExecute ¶
ProxyExecute relays an execution call through the node so HTTPS callers can reach plain-HTTP agent endpoints on the VM. POST /agents/proxy-execute.
type Benchmarks ¶
type Benchmarks struct {
// contains filtered or unexported fields
}
Benchmarks is the benchmarks sub-resource. (Distinct from Evals — Evals is the v3 /evals/runs surface; this is the legacy /benchmarks/ surface.)
type Catalog ¶
type Catalog struct {
// contains filtered or unexported fields
}
Catalog is the model-catalog sub-resource (Browse Models in the UI).
type ChatRequest ¶
type ChatRequest struct {
Provider string // required (e.g. "anthropic", "openai", "ollama")
Model string // required
Message string // required
AgentType string // optional ("coding", "devops", "git", ...)
SessionID string // optional — continues a prior session
}
ChatRequest describes one LLM chat call.
type Client ¶
type Client struct {
T *transport.Transport
NodeURL string
// TenantID is sent as X-Tenant-ID on every call. Required.
TenantID string
}
Client is the AgentControl facade. Construct via c.AgentControl().
func (*Client) Agents ¶
Agents returns the server-side agents sub-resource. These are distinct from c.Agents() (client-side AI orchestration) — they persist in the agentcontrol DB and run via /agents/{id}/execute.
func (*Client) Benchmarks ¶
func (c *Client) Benchmarks() *Benchmarks
Benchmarks returns the benchmarks sub-resource (separate from Evals).
func (*Client) DeployTargets ¶
func (c *Client) DeployTargets() *DeployTargets
DeployTargets returns the deploy-target provisioning sub-resource.
func (*Client) Deployments ¶
func (c *Client) Deployments() *Deployments
Deployments returns the agentcontrol Deployments sub-resource (model endpoints — create, sync, status, delete).
func (*Client) Embeddings ¶
func (c *Client) Embeddings() *Embeddings
Embeddings returns the vector-artifacts sub-resource (FAISS / ChromaDB).
func (*Client) FineTuning ¶
func (c *Client) FineTuning() *FineTuning
FineTuning returns the fine-tuning-jobs sub-resource.
func (*Client) MCP ¶
MCP returns the MCP-servers sub-resource. Note: per project-mcp-split-brain memory, the MCP route is Cloudflare bot-blocked for non-browser callers on some environments; expect HTTP 403 "error code: 1010" if so. Use a browser User-Agent header on the Transport to work around it.
func (*Client) Models ¶
Models returns the agentcontrol-side Models sub-resource (UI uploads, soft-delete, state changes). Distinct from the marketplace catalog.
func (*Client) RuntimeMetrics ¶
RuntimeMetrics proxies a metrics-endpoint scrape through the node. endpoint is the agent's metrics URL (e.g. "http://1.2.3.4:8000/metrics"). Used by the My Agents tab to show requests/errors/latency without CORS issues.
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
Code is the Programming-tab sub-resource — runs editor content and persists saved snippets on the tenant node via the Go shim's /code/* routes.
func (*Code) DeleteSaved ¶
DeleteSaved removes one saved snippet.
type Datasets ¶
type Datasets struct {
// contains filtered or unexported fields
}
Datasets is the datasets sub-resource.
func (*Datasets) Create ¶
Create (metadata-only) adds a dataset row without uploading content. Distinct from Upload, which posts the file body via multipart.
func (*Datasets) Download ¶
Download returns the raw dataset bytes. Callers handle the filename (typically derived from a Content-Disposition header on the HTTP response — for that, use BytesWithHeaders directly).
type DeployTargets ¶
type DeployTargets struct {
// contains filtered or unexported fields
}
DeployTargets is the deploy-target provisioning sub-resource.
func (*DeployTargets) List ¶
func (r *DeployTargets) List(ctx context.Context) ([]Result, error)
List returns all deploy targets registered for the tenant.
func (*DeployTargets) Provision ¶
func (r *DeployTargets) Provision(ctx context.Context, in ProvisionInput) (Result, error)
Provision starts a new deploy-target VM. Returns a session_id the caller uses with ProvisionStatus to poll.
func (*DeployTargets) ProvisionStatus ¶
func (r *DeployTargets) ProvisionStatus(ctx context.Context, sessionID, username string) (Result, error)
ProvisionStatus polls a provisioning session.
type Deployments ¶
type Deployments struct {
// contains filtered or unexported fields
}
Deployments is the model-endpoints sub-resource (Models tab > My Deployments).
func (*Deployments) Create ¶
Create starts a deployment. spec must include at least name and model_id.
func (*Deployments) DeleteAll ¶
func (r *Deployments) DeleteAll(ctx context.Context) (Result, error)
DeleteAll removes every deployment row for the tenant.
func (*Deployments) List ¶
func (r *Deployments) List(ctx context.Context) ([]Result, error)
List returns all deployment rows.
type Embeddings ¶
type Embeddings struct {
// contains filtered or unexported fields
}
Embeddings is the vector-artifacts sub-resource. Backs the Embeddings tab.
func (*Embeddings) DeleteAll ¶
func (r *Embeddings) DeleteAll(ctx context.Context) (Result, error)
DeleteAll wipes every embedding artifact for the tenant. Requires the caller to opt in via confirm=true (also reflected in the UI's red button).
func (*Embeddings) Download ¶
Download fetches a raw zip part of the embedding bundle. `part` is one of "faiss" or "chromadb" (other parts may be added server-side later).
func (*Embeddings) List ¶
func (r *Embeddings) List(ctx context.Context) ([]Result, error)
List returns all embedding artifacts for the tenant. The collection URL uses no trailing slash on this route (unlike the others) — matches /api/v2/agentcontrol/embeddings.
func (*Embeddings) Promote ¶
Promote registers the embedding artifact as a production model so it shows up in Models & Endpoints. Returns the new model_id.
func (*Embeddings) Query ¶
Query runs a semantic query against an artifact and returns the top-K hits. question is the natural-language query; topK defaults to 5 when <= 0.
type Evals ¶
type Evals struct {
// contains filtered or unexported fields
}
Evals is the evaluation-runs sub-resource (Benchmarks tab).
func (*Evals) CreateRun ¶
CreateRun starts an eval run. spec must include at least name. The SDK auto-injects tenant_id into the body — the v3 route requires it there in addition to the X-Tenant-ID header.
func (*Evals) FeedbackStats ¶
FeedbackStats returns aggregate feedback statistics for the tenant.
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events is the event-bus sub-resource.
type FineTuning ¶
type FineTuning struct {
// contains filtered or unexported fields
}
FineTuning is the fine-tuning-jobs sub-resource.
func (*FineTuning) Create ¶
Create starts a fine-tuning job. spec must include at least name, base_model and training_file.
func (*FineTuning) DeleteAll ¶
func (r *FineTuning) DeleteAll(ctx context.Context) (Result, error)
DeleteAll wipes every fine-tuning job for the tenant.
func (*FineTuning) List ¶
func (r *FineTuning) List(ctx context.Context) ([]Result, error)
List returns all fine-tuning jobs for the tenant.
func (*FineTuning) Wait ¶
func (r *FineTuning) Wait(ctx context.Context, jobID string, opts WaitOptions) (Result, error)
Wait polls a fine-tuning job until its status is terminal.
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub is the GitHub dataset-import sub-resource.
func (*GitHub) ImportDataset ¶
ImportDataset imports a dataset from a GitHub repository.
func (*GitHub) RepoContents ¶
RepoContents returns either one file object (with base64 `content`) or an array when the path points to a directory. Used by the Programming tab's "Import from GitHub" button.
type GitHubContentsInput ¶
type GitHubContentsInput struct {
Owner string // required
Repo string // required
Path string // optional — directory or file path within the repo
Ref string // optional — branch/sha; defaults to main on the server
}
GitHubContentsInput describes a GitHub repo-contents fetch.
type Health ¶
type Health struct {
// contains filtered or unexported fields
}
Health is the model-health sub-resource.
type ImportDatasetInput ¶
type ImportDatasetInput struct {
Repo string // owner/name (required)
Branch string // default "main"
Path string // path within the repo
Name string // dataset name; defaults to the repo basename
}
ImportDatasetInput describes a GitHub dataset import.
type Infra ¶
type Infra struct {
// contains filtered or unexported fields
}
Infra is the infrastructure-discovery sub-resource — returns the list of reachable agentcontrol endpoints on the tenant node.
type Knowledge ¶
type Knowledge struct {
// contains filtered or unexported fields
}
Knowledge is the knowledge-bases sub-resource.
type LLM ¶
type LLM struct {
// contains filtered or unexported fields
}
LLM is the in-node LLM-chat sub-resource. Distinct from the standalone vxsdk Chat client — this one runs through agentcontrol's agent dispatcher.
type MCP ¶
type MCP struct {
// contains filtered or unexported fields
}
MCP is the MCP-servers sub-resource.
type Models ¶
type Models struct {
// contains filtered or unexported fields
}
Models is the agentcontrol Models sub-resource — what the UI's "Upload Custom" + "Soft-Delete All" buttons hit.
func (*Models) ExportTrainingData ¶
ExportTrainingData exports the model's training-data bundle.
type ProvisionInput ¶
type ProvisionInput struct {
CloudProvider string // e.g. "aws", "vxcloud"
Region string
InstanceType string
OS string
InstanceName string
}
ProvisionInput describes a deploy-target provisioning request.
type ProxyExecuteInput ¶
type ProxyExecuteInput struct {
Endpoint string // required — the agent's HTTP base URL
Message string // required
SessionID string // optional
Path string // optional — append to endpoint (e.g. "/chat")
PayloadMode string // optional — "auto"|"message"|"prompt"|"query"|"input"|"common"
}
ProxyExecuteInput describes a node-mediated execute call against a marketplace agent running on the tenant VM. The UI uses this for mixed- content reasons (HTTPS browser cannot directly call HTTP endpoints).
type RunOptions ¶
type RunOptions struct {
Filename string // optional
Language string // "python"|"py"|"bash"|"sh"|"shell" (required)
Content string // source body (required)
Env map[string]string // optional env vars
TimeoutSecs int // optional, 0 = server default
Args []string // optional argv after the script
}
RunOptions describes a Code.Run request.
type Tools ¶
type Tools struct {
// contains filtered or unexported fields
}
Tools is the tools & actions sub-resource.
type Training ¶
type Training struct {
// contains filtered or unexported fields
}
Training is the model-training-jobs sub-resource.
func (*Training) Create ¶
Create starts a training job. spec must include at least name, base_model and dataset_id.
func (*Training) DeleteAll ¶
DeleteAll removes every training job for the tenant. typeFilter, if non-empty, scopes to that type (e.g. "pipeline" to mirror the UI's Pipelines-tab "Delete All").
type TrainingChatRequest ¶
type TrainingChatRequest struct {
Message string // required
SessionID string // optional
ModelID string // optional, picks which trained model to chat with
}
ChatRequest is the body of a Training.Chat call.
type UploadOptions ¶
type UploadOptions struct {
Name string // dataset name (required)
Type string // dataset type; default "training"
Format string // file format; default "csv"
}
UploadOptions describes a dataset upload.
type WaitOptions ¶
type WaitOptions struct {
Timeout time.Duration // default 30m
Interval time.Duration // default 5s
// OnTick, if set, is called with the latest job Result after each poll.
OnTick func(Result)
}
WaitOptions tunes the job poller. Zero values fall back to the defaults.
type WebAssets ¶
type WebAssets struct {
// contains filtered or unexported fields
}
WebAssets is the Web-Assets sub-resource.
type Workflows ¶
type Workflows struct {
// contains filtered or unexported fields
}
Workflows is the agentcontrol workflow-shim sub-resource. The full workflow surface (definitions, executions, etc.) lives on the workflow service, not on agentcontrol — this just exposes the two routes the UI hits to list and trigger from inside the agentcontrol context.