Confirm agent candidate solutions¶
Confirm the candidates and try to load the agent configuration. Confirmation includes multi-stage writing, and after failure, candidate and loaded versions need to be checked.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/commit
Before you call¶
Configure the CloudSigma regional endpoint and authentication before calling. The endpoint, credentials, workspace, and resource IDs must belong to the same region.
First generate the agent candidate plan or regenerate the agent candidate plan to obtain the candidate version and source_digest. Prepare the personal access token, target workspace ID, agent ID, and candidate version that can access the target workspace.
Request body¶
Replace $WORKSPACE_ID, $AGENT_ID, $CANDIDATE_VERSION, $CLOUDSIGMA_API_KEY, $SOURCE_DIGEST in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-builder/candidates/$AGENT_ID/candidate-versions/$CANDIDATE_VERSION/commit" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"source_digest": "'"$SOURCE_DIGEST"'"
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
workspace ID. |
|
string |
Yes |
agent ID. |
|
string |
Yes |
Release Candidate. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
A summary of the current candidate response. Cannot be empty. |
|
object |
No |
Metadata to be written. |
|
object |
No |
runtime environment binding override. |
|
array of object or null |
No |
Skill reference. |
|
string |
No |
logo. |
|
string |
No |
The workspace ID to which it belongs. |
|
string |
No |
The entry type determines the structure of the spec. |
|
string |
No |
status. |
|
string |
No |
Resource ID. |
|
string |
No |
Name. |
|
string |
No |
Display name. |
|
string |
No |
Description. |
|
string |
No |
Resource category. |
|
string |
No |
execution phase. |
|
boolean |
No |
Whether it can be bound. |
|
string |
No |
Binding availability instructions. |
|
array of string |
No |
Supported runtime environments. |
|
object |
No |
Configuration. |
|
string |
No |
Run tool visibility. |
|
string |
No |
Binding source. |
|
boolean |
No |
Is it manageable. |
|
array of object or null |
No |
Tool reference. |
|
string |
No |
logo. |
|
string |
No |
The workspace ID to which it belongs. |
|
string |
No |
The entry type determines the structure of the spec. |
|
string |
No |
status. |
|
string |
No |
Resource ID. |
|
string |
No |
Name. |
|
string |
No |
Display name. |
|
string |
No |
Description. |
|
string |
No |
Resource category. |
|
string |
No |
execution phase. |
|
boolean |
No |
Whether it can be bound. |
|
string |
No |
Binding availability instructions. |
|
array of string |
No |
Supported runtime environments. |
|
object |
No |
Configuration. |
|
string |
No |
Run tool visibility. |
|
string |
No |
Binding source. |
|
boolean |
No |
Is it manageable. |
|
array of object or null |
No |
knowledge base reference. |
|
string |
No |
logo. |
|
string |
No |
The workspace ID to which it belongs. |
|
string |
No |
The entry type determines the structure of the spec. |
|
string |
No |
status. |
|
string |
No |
Resource ID. |
|
string |
No |
Name. |
|
string |
No |
Display name. |
|
string |
No |
Description. |
|
string |
No |
Resource category. |
|
string |
No |
execution phase. |
|
boolean |
No |
Whether it can be bound. |
|
string |
No |
Binding availability instructions. |
|
array of string |
No |
Supported runtime environments. |
|
object |
No |
Configuration. |
|
string |
No |
Run tool visibility. |
|
string |
No |
Binding source. |
|
boolean |
No |
Is it manageable. |
|
array of object or null |
No |
Channel binding. |
|
string |
No |
Provider. |
|
string |
No |
Channel type. |
|
array of string or null |
No |
Channel instance ID. |
Only supported bindings and tool configuration fields are used when loading. The default configuration is retained when config is omitted. When the same tool appears multiple times, the configuration is overwritten in sequence. When the resource workspace is omitted, the current workspace is used.
Unknown fields or unsupported combinations may be rejected. Presentation fields cannot be used to specify resource identities.
When channel binding is omitted or null is filled in, the candidate binding is retained, and when [] is filled in it is cleared. Basic member configurations may also be merged during loading, please refer to the loaded configuration.
metadata will be replaced as a whole and will not be merged with the original value. Keys that need to be retained must be resubmitted. The following reserved keys cannot be overridden: agent_package_id, agent_package_version, agent_package_source_digest, agent_package_load_status, agent_package_resource_files, momo_foundation_membership_snapshot and momo_foundation_membership_snapshot_refs.
Successful response¶
{
"code": 0,
"data": {
"workspace_id": "ws_01",
"agent_id": "agent_01",
"name": "产品助手",
"load_version": "0.2.0",
"source_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
"package_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000"
}
}
Field |
Type |
Description |
|---|---|---|
|
string |
The workspace, identity, and name of the loaded agent. |
|
string |
The workspace, identity, and name of the loaded agent. |
|
string |
The workspace, identity, and name of the loaded agent. |
|
string |
Version loaded. Used to Query the current agent configuration. |
|
string |
Confirmed candidate content summary and loaded package summary. |
|
string |
Confirmed candidate content summary and loaded package summary. |
Error response¶
{
"code": 4,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
The request contains unknown fields, candidate content, or the binding override is invalid. Recommendation: Check the request body and candidate diagnostics. |
|
|
Valid identity credentials are missing. Recommendation: Check the API Key. |
|
|
The current identity does not have the authority to confirm the candidate. Suggestion: Check workspace and agent authorization. |
|
|
The release candidate does not exist. Recommendation: Check out the release candidates. |
|
|
The candidate summary does not match, the candidate has been replaced, or the current status cannot be confirmed. Recommendation: Get the latest candidate and use its |
|
|
Candidate loading failed. Recommendation: Correct the configuration according to the candidate diagnosis and regenerate. |
|
|
Agent building or authorization services are temporarily unavailable. Suggestion: Check the current status first. Do not automatically resubmit. |