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.

HTTP
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.

Shell
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

workspace_id

string

Yes

workspace ID.

agent_id

string

Yes

agent ID.

candidate_version

string

Yes

Release Candidate.

Request body

Field

Type

Required

Description

source_digest

string

Yes

A summary of the current candidate response. Cannot be empty.

metadata

object

No

Metadata to be written.

binding

object

No

runtime environment binding override.

binding.skill_refs

array of object or null

No

Skill reference.

binding.skill_refs[].id

string

No

logo.

binding.skill_refs[].workspace_id

string

No

The workspace ID to which it belongs.

binding.skill_refs[].kind

string

No

The entry type determines the structure of the spec.

binding.skill_refs[].status

string

No

status.

binding.skill_refs[].resource_id

string

No

Resource ID.

binding.skill_refs[].name

string

No

Name.

binding.skill_refs[].display_name

string

No

Display name.

binding.skill_refs[].description

string

No

Description.

binding.skill_refs[].category

string

No

Resource category.

binding.skill_refs[].phase

string

No

execution phase.

binding.skill_refs[].bindable

boolean

No

Whether it can be bound.

binding.skill_refs[].bindability_reason

string

No

Binding availability instructions.

binding.skill_refs[].supported_runtimes

array of string

No

Supported runtime environments.

binding.skill_refs[].config

object

No

Configuration.

binding.skill_refs[].runtime_tool_visibility

string

No

Run tool visibility.

binding.skill_refs[].binding_source

string

No

Binding source.

binding.skill_refs[].manageable

boolean

No

Is it manageable.

binding.tool_refs

array of object or null

No

Tool reference.

binding.tool_refs[].id

string

No

logo.

binding.tool_refs[].workspace_id

string

No

The workspace ID to which it belongs.

binding.tool_refs[].kind

string

No

The entry type determines the structure of the spec.

binding.tool_refs[].status

string

No

status.

binding.tool_refs[].resource_id

string

No

Resource ID.

binding.tool_refs[].name

string

No

Name.

binding.tool_refs[].display_name

string

No

Display name.

binding.tool_refs[].description

string

No

Description.

binding.tool_refs[].category

string

No

Resource category.

binding.tool_refs[].phase

string

No

execution phase.

binding.tool_refs[].bindable

boolean

No

Whether it can be bound.

binding.tool_refs[].bindability_reason

string

No

Binding availability instructions.

binding.tool_refs[].supported_runtimes

array of string

No

Supported runtime environments.

binding.tool_refs[].config

object

No

Configuration.

binding.tool_refs[].runtime_tool_visibility

string

No

Run tool visibility.

binding.tool_refs[].binding_source

string

No

Binding source.

binding.tool_refs[].manageable

boolean

No

Is it manageable.

binding.knowledge_base_refs

array of object or null

No

knowledge base reference.

binding.knowledge_base_refs[].id

string

No

logo.

binding.knowledge_base_refs[].workspace_id

string

No

The workspace ID to which it belongs.

binding.knowledge_base_refs[].kind

string

No

The entry type determines the structure of the spec.

binding.knowledge_base_refs[].status

string

No

status.

binding.knowledge_base_refs[].resource_id

string

No

Resource ID.

binding.knowledge_base_refs[].name

string

No

Name.

binding.knowledge_base_refs[].display_name

string

No

Display name.

binding.knowledge_base_refs[].description

string

No

Description.

binding.knowledge_base_refs[].category

string

No

Resource category.

binding.knowledge_base_refs[].phase

string

No

execution phase.

binding.knowledge_base_refs[].bindable

boolean

No

Whether it can be bound.

binding.knowledge_base_refs[].bindability_reason

string

No

Binding availability instructions.

binding.knowledge_base_refs[].supported_runtimes

array of string

No

Supported runtime environments.

binding.knowledge_base_refs[].config

object

No

Configuration.

binding.knowledge_base_refs[].runtime_tool_visibility

string

No

Run tool visibility.

binding.knowledge_base_refs[].binding_source

string

No

Binding source.

binding.knowledge_base_refs[].manageable

boolean

No

Is it manageable.

binding.channel_bindings

array of object or null

No

Channel binding.

binding.channel_bindings[].provider

string

No

Provider.

binding.channel_bindings[].channel_type

string

No

Channel type.

binding.channel_bindings[].channel_instance_ids

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

JSON
{
  "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

data.workspace_id

string

The workspace, identity, and name of the loaded agent.

data.agent_id

string

The workspace, identity, and name of the loaded agent.

data.name

string

The workspace, identity, and name of the loaded agent.

data.load_version

string

Version loaded. Used to Query the current agent configuration.

data.source_digest

string

Confirmed candidate content summary and loaded package summary.

data.package_digest

string

Confirmed candidate content summary and loaded package summary.

Error response

JSON
{
  "code": 4,
  "message": "<错误信息>"
}

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

The request contains unknown fields, candidate content, or the binding override is invalid. Recommendation: Check the request body and candidate diagnostics.

401

6(UNAUTHENTICATED)

Valid identity credentials are missing. Recommendation: Check the API Key.

403

5(PERMISSION_DENIED)

The current identity does not have the authority to confirm the candidate. Suggestion: Check workspace and agent authorization.

404

3(NOT_FOUND)

The release candidate does not exist. Recommendation: Check out the release candidates.

409

4(ALREADY_EXISTS)

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 source_digest.

500

1(INTERNAL)

Candidate loading failed. Recommendation: Correct the configuration according to the candidate diagnosis and regenerate.

503

15(UNAVAILABLE)

Agent building or authorization services are temporarily unavailable. Suggestion: Check the current status first. Do not automatically resubmit.

Last updated on