Regenerate agent candidate solutions¶
Generate new editable candidate versions based on existing candidates and coverage fields.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/repropose
Preparation before calling¶
First generate the agent candidate solution to obtain the candidate version and source_digest. Prepare a personal access token with access to the target workspace, target workspace ID, agent ID, and release candidate.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: Target workspace ID, passed through theX-Workspace-IDHeader and also asworkspace_idin the path.$AGENT_ID: Agent ID, asagent_idin the path.$CANDIDATE_VERSION: The current release candidate, ascandidate_versionin the path.$SOURCE_DIGEST: Digest from the current candidate response forsource_digestin the request body.
Request example¶
curl -X POST "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/agent-builder/candidates/$AGENT_ID/candidate-versions/$CANDIDATE_VERSION/repropose" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"source_digest": "'"$SOURCE_DIGEST"'",
"overrides": {
"agent_md": "<UPDATED_AGENT_MD>"
}
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Agent ID. |
|
string |
Yes |
The current release candidate. |
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The digest in the current candidate response, used for concurrent verification. |
|
object |
Yes |
Candidate fields to overwrite. |
Successful response¶
Returns 200 on success. data is a new release candidate; the original candidate does not automatically become a loaded release because the request is accepted.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"candidate_version": "cand_02",
"load_version": "v1",
"source_digest": "sha256:<HEX_DIGEST>",
"mode": "revise",
"status": "valid",
"display": {
"agent_name": "产品助手"
},
"diagnostics": []
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
The new release candidate and its summary; used when confirming or canceling. |
|
string |
The new release candidate and its summary; used when confirming or canceling. |
|
string |
The loaded version used after the candidate is confirmed. |
|
string |
Candidate status, display content, diagnostics, and resolved resource references. |
|
object |
Candidate status, display content, diagnostics, and resolved resource references. |
|
array |
Candidate status, display content, diagnostics, and resolved resource references. |
|
object |
Candidate status, display content, diagnostics, and resolved resource references. |
Error response¶
{
"code": 4,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The coverage field is unknown, the type is invalid, or the requested field is incomplete. |
Only submit fields supported by |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to revise the candidate. |
Check workspace and agent authorizations. |
|
|
Release candidate does not exist. |
Check for release candidates. |
|
|
|
Generate again after reading the latest candidate. |
|
|
Candidate build failed. |
Try again later. |
|
|
Agent construction or authorization services are temporarily unavailable. |
Try again later. |
Follow-up operations¶
After checking the new candidate, Confirm agent candidate solutions, or Cancel the agent candidate plan.