Regenerate agent candidate solutions

Modify valid candidates and replace old versions. Please check the verification status of the new candidate. The information currently returned may not be sufficient to reconstruct the complete input.

HTTP
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-builder/candidates/{agent_id}/candidate-versions/{candidate_version}/repropose

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 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/repropose" \
  -H "X-API-Key: $CLOUDSIGMA_API_KEY" \
  -H "X-Workspace-ID: $WORKSPACE_ID" \
  -H 'Content-Type: application/json' \
  -d '{
    "source_digest": "'"$SOURCE_DIGEST"'",
    "overrides": {
      "agent_md": "<UPDATED_AGENT_MD>"
    }
  }'

Parameter

Type

Required

Description

workspace_id

string

Yes

workspace ID.

agent_id

string

Yes

agent ID.

candidate_version

string

Yes

Current release candidate.

Request body

Field

Type

Required

Description

source_digest

string

Yes

Digest of the current candidate response, used for concurrent verification. Cannot be empty.

overrides

object

No

Candidate fields to overwrite.

overrides.agent_md

string

No

agentMarkdown text.

overrides.tool_names

array of string

No

Tool name.

overrides.skill_names

array of string

No

Skill name.

overrides.knowledge_base_names

array of string

No

knowledge base name.

overrides.catalog_files

array of object

No

Catalog file reference.

overrides.catalog_files[].workspace_id

string

When the object is provided

The workspace ID to which it belongs. Cannot be empty.

overrides.catalog_files[].volume_id

integer

When the object is provided

Volume ID. Not less than 1.

overrides.catalog_files[].file_id

string

When the object is provided

File ID. Cannot be empty.

overrides.channel_bindings

array of object

No

Candidate channel binding, can be omitted.

overrides.channel_bindings[].tool_name

string

No

Tool name.

overrides.channel_bindings[].tool_workspace_id

string

No

Tool source workspace ID.

overrides.channel_bindings[].skill_name

string

No

Skill name.

overrides.channel_bindings[].skill_workspace_id

string

No

Skill source workspace ID.

overrides.channel_bindings[].provider

string

No

Provider.

overrides.channel_bindings[].workspace_id

string

When the object is provided

The workspace ID to which it belongs.

overrides.channel_bindings[].instance_id

string

When the object is provided

Channel instance ID.

changes

object

No

Change collection.

overrides and changes Choose one to fill in. When overrides is empty, the request body is null or does not contain actual modifications, the request will be rejected.

Successful response

JSON
{
  "code": 0,
  "data": {
    "render_type": "agent_candidate",
    "workspace_id": "ws_01",
    "agent_id": "agent_01",
    "candidate_version": "0.2.0",
    "load_version": "0.2.0",
    "source_digest": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
    "mode": "revise",
    "status": "valid",
    "display": {
      "agent_name": "产品助手",
      "agent_id": "",
      "candidate_version": "0.2.0",
      "load_version": "0.2.0",
      "model": "",
      "tools": null,
      "skills": null,
      "knowledge_bases": null,
      "catalog_files": [],
      "channel_bindings": [],
      "agent_md": "",
      "change_reason": ""
    },
    "resolved_refs": {},
    "package_summary": {
      "manifest_path": "",
      "prompt_path": "",
      "file_paths": []
    }
  }
}

Field

Type

Description

data.render_type

string

Display type. Fixed to “agent_candidate”.

data.workspace_id

string

The workspace ID to which it belongs.

data.agent_id

string

agent ID.

data.candidate_version

string

New release candidates and their summary. Used when confirming or canceling.

data.load_version

string

The loaded version to use after this candidate is confirmed.

data.source_digest

string

New release candidates and their summary. Used when confirming or canceling.

data.mode

string

processing mode. Value: create, revise.

data.status

string

Candidate status, display content, diagnostics, and resolved resource references. Value: valid, invalid.

data.display

object

Candidate status, display content, diagnostics, and resolved resource references.

data.display.agent_name

string

agent name.

data.display.agent_id

string

agent ID.

data.display.candidate_version

string

Release Candidate.

data.display.load_version

string

Load version.

data.display.model

string

model.

data.display.tools

array of string or null

Tool collection.

data.display.skills

array of string or null

Skill set.

data.display.knowledge_bases

array of string or null

knowledge base reference.

data.display.catalog_files

array of object

Catalog file reference.

data.display.catalog_files[].workspace_id

string

The workspace ID to which it belongs.

data.display.catalog_files[].volume_id

integer

Volume ID.

data.display.catalog_files[].file_id

string

File ID.

data.display.channel_bindings

array of object

Channel binding.

data.display.channel_bindings[].tool_name

string

Tool name.

data.display.channel_bindings[].tool_workspace_id

string

Tool source workspace ID.

data.display.channel_bindings[].skill_name

string

Skill name.

data.display.channel_bindings[].skill_workspace_id

string

Skill source workspace ID.

data.display.channel_bindings[].provider

string

Provider.

data.display.channel_bindings[].workspace_id

string

The workspace ID to which it belongs.

data.display.channel_bindings[].instance_id

string

Channel instance ID.

data.display.agent_md

string

agentMarkdown text.

data.display.change_reason

string

Reason for change.

data.diagnostics

array of object

Candidate status, display content, diagnostics, and resolved resource references. At least 1 items.

data.diagnostics[].severity

string

Diagnostic level.

data.diagnostics[].code

string

Error or diagnostic code.

data.diagnostics[].message

string

Message content.

data.diagnostics[].field_path

string

Field path.

data.diagnostics[].resource_ref

string

Resource references.

data.resolved_refs

object

Candidate status, display content, diagnostics, and resolved resource references.

data.resolved_refs.model

object

model.

data.resolved_refs.model.name

string

Name.

data.resolved_refs.model.id

string

logo.

data.resolved_refs.model.workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.model.requested_name

string

The name when requested.

data.resolved_refs.tools

array of object

Tool collection.

data.resolved_refs.tools[].name

string

Name.

data.resolved_refs.tools[].id

string

logo.

data.resolved_refs.tools[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.tools[].requested_name

string

The name when requested.

data.resolved_refs.skills

array of object

Skill set.

data.resolved_refs.skills[].name

string

Name.

data.resolved_refs.skills[].id

string

logo.

data.resolved_refs.skills[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.skills[].requested_name

string

The name when requested.

data.resolved_refs.skill_tools

array of object

Skill tool mapping.

data.resolved_refs.skill_tools[].skill_name

string

Skill name.

data.resolved_refs.skill_tools[].skill_id

string

Skill ID.

data.resolved_refs.skill_tools[].skill_workspace_id

string

Skill source workspace ID.

data.resolved_refs.skill_tools[].tool_name

string

Tool name.

data.resolved_refs.skill_tools[].tool_id

string

Tool ID.

data.resolved_refs.skill_tools[].tool_workspace_id

string

Tool source workspace ID.

data.resolved_refs.knowledge_bases

array of object

knowledge base reference.

data.resolved_refs.knowledge_bases[].name

string

Name.

data.resolved_refs.knowledge_bases[].id

string

logo.

data.resolved_refs.knowledge_bases[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.knowledge_bases[].requested_name

string

The name when requested.

data.resolved_refs.catalog_files

array of object

Catalog file reference.

data.resolved_refs.catalog_files[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.catalog_files[].volume_id

integer

Volume ID.

data.resolved_refs.catalog_files[].file_id

string

File ID.

data.resolved_refs.channel_bindings

array of object

Channel binding.

data.resolved_refs.channel_bindings[].tool_name

string

Tool name.

data.resolved_refs.channel_bindings[].tool_workspace_id

string

Tool source workspace ID.

data.resolved_refs.channel_bindings[].skill_name

string

Skill name.

data.resolved_refs.channel_bindings[].skill_workspace_id

string

Skill source workspace ID.

data.resolved_refs.channel_bindings[].provider

string

Provider.

data.resolved_refs.channel_bindings[].workspace_id

string

The workspace ID to which it belongs.

data.resolved_refs.channel_bindings[].instance_id

string

Channel instance ID.

data.package_summary

object

Summary of candidate packages.

data.package_summary.manifest_path

string

Manifest file path.

data.package_summary.prompt_path

string

Prompt word file path.

data.package_summary.file_paths

array of string

List of file paths.

Error response

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

Common HTTP errors

HTTP status code

error code

Description

400

2(INVALID_ARGUMENT)

The coverage field is unknown, the type is invalid, or the requested field is incomplete. Suggestion: Only submit fields supported by overrides.

401

6(UNAUTHENTICATED)

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

403

5(PERMISSION_DENIED)

The current identity does not have permission to revise 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)

source_digest has expired, the candidate has been replaced, or there is a concurrent authoring conflict. Suggestion: read the latest candidate and generate again.

500

1(INTERNAL)

Candidate build failed. Suggestion: Check the current status first. Do not automatically resubmit.

503

15(UNAVAILABLE)

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

Last updated on