Cancel the agent candidate plan¶
Cancel an unconfirmed agent candidate.
POST https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/cancel
Preparation before calling¶
First generate the agent candidate program or regenerate the agent candidate program] 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: Candidate version to cancel, 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/cancel" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"source_digest": "'"$SOURCE_DIGEST"'"
}'
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Agent ID. |
|
string |
Yes |
Candidate version to cancel. |
Request body¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
The digest in the current candidate response. |
Successful response¶
Returns 200 on success. data returns the candidate after cancellation; status is superseded.
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"candidate_version": "cand_01",
"source_digest": "sha256:<HEX_DIGEST>",
"status": "superseded",
"display": {
"agent_name": "产品助手"
},
"diagnostics": []
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
string |
The workspace, agent and version candidate to which the candidate belongs. |
|
string |
The workspace, agent and version candidate to which the candidate belongs. |
|
string |
The workspace, agent and version candidate to which the candidate belongs. |
|
string |
Content summary of canceled candidates. |
|
string |
|
|
object |
Display candidate content, diagnostics, and resolved resource references. |
|
array |
Candidate display content, diagnostics, and resolved resource references. |
|
object |
Display candidate content, diagnostics, and resolved resource references. |
Error response¶
{
"code": 4,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
The request contains unknown fields or |
Check the request body. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have the authority to cancel candidacy. |
Check workspace and agent authorizations. |
|
|
Release candidate does not exist. |
Check for release candidates. |
|
|
The digest does not match, the candidate has been replaced, or the current status does not allow cancellation. |
Try again after getting the latest candidate. |
|
|
An internal error occurred while canceling the candidate. |
Try again later. |
|
|
Agent construction or authorization services are temporarily unavailable. |
Try again later. |
Follow-up operations¶
When you need to continue building, Generate agent candidate solutions.