Generate agent candidate solutions¶
Submit a complete agent candidate configuration, and the service will verify and save the candidate version.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/agent-builder/candidates
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 Query the available resources for agent construction to obtain the resource list. Prepare a personal access token and target workspace ID that can access the target workspace.
Request body¶
Replace $WORKSPACE_ID, $CLOUDSIGMA_API_KEY in the example with actual values.
curl -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/agent-builder/candidates" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"mode": "create",
"conversation_id": "<CONVERSATION_ID>",
"raw_advice": "创建一个回答产品问题的智能体。",
"resources": {
"models": [],
"tools": [],
"skills": [],
"knowledge_bases": []
},
"candidate": {
"agent_id": "<AGENT_ID>",
"name": "产品助手",
"description": "回答产品问题。",
"model_name": "<MODEL_NAME>",
"tool_names": [],
"skill_names": [],
"knowledge_base_names": [],
"channel_bindings": [],
"agent_md": "# 产品助手",
"change_reason": "初始创建"
}
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
workspace ID. |
Request body
Field |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Build mode. To create a new agent use create. Value: |
|
string |
Yes |
The session ID to which this build belongs. Cannot be empty. |
|
string |
No |
The associated task ID. |
|
string |
No |
Source agent ID. |
|
string |
No |
Source agentworkspace. Cannot be empty. |
|
string |
No |
Source version. |
|
string |
Yes |
The original request for this creation or modification. |
|
string |
No |
Proposed user ID. |
|
object |
Yes |
Select the resource collection returned in the build resource. |
|
array of object |
When the object is provided |
Model collection. |
|
string |
When the object is provided |
Name. Cannot be empty. |
|
string |
No |
Model name. |
|
string |
No |
Display name. |
|
string |
No |
Model configuration reference. |
|
array of object |
When the object is provided |
Tool collection. |
|
string |
When the object is provided |
Name. Cannot be empty. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
array of object |
When the object is provided |
Skill set. |
|
string |
When the object is provided |
Name. Cannot be empty. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
array of object |
When the object is provided |
knowledge base reference. |
|
string |
When the object is provided |
Name. Cannot be empty. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
object |
No |
Complete candidate agent configuration. |
|
string |
When the object is provided |
The new candidate agent ID. Cannot be empty. |
|
string |
When the object is provided |
agent name. |
|
string |
When the object is provided |
agent description. |
|
string |
When the object is provided |
Model names available in |
|
string |
No |
Model configuration reference. |
|
array of string |
When the object is provided |
The name of the selected tool. Pass an empty array when there are no tools. |
|
array of string |
When the object is provided |
The name of the selected skill. Pass empty array when there is no skill. |
|
array of string |
When the object is provided |
The selected knowledge base name. If there is no knowledge base, an empty array is passed. |
|
array of object |
No |
Catalog file reference. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
integer |
When the object is provided |
Volume ID. Not less than 1. |
|
string |
When the object is provided |
File ID. Cannot be empty. |
|
array of object |
No |
Candidate channel binding, can be omitted. |
|
string |
No |
Tool name. |
|
string |
No |
Tool source workspace ID. |
|
string |
No |
Skill name. |
|
string |
No |
Skill source workspace ID. |
|
string |
No |
Provider. |
|
string |
When the object is provided |
The workspace ID to which it belongs. |
|
string |
When the object is provided |
Channel instance ID. |
|
string |
When the object is provided |
Editable agent Markdown text. |
|
string |
When the object is provided |
Reason for this candidate change. |
|
object |
No |
Full source citation. |
|
array of object |
When the object is provided |
Tool collection. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
array of object |
When the object is provided |
Skill set. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
array of object |
When the object is provided |
knowledge base reference. |
|
string |
When the object is provided |
logo. Cannot be empty. |
|
string |
When the object is provided |
The workspace ID to which it belongs. Cannot be empty. |
|
object |
No |
Change collection. |
Entries for candidate.catalog_files include workspace_id, volume_id, and file_id. channel_bindings can be omitted when the candidate has no channel binding.
candidate and changes cannot be submitted at the same time. Fill in base_revision when revising, and retain complete resource citation information. When using changes, fill in the structure according to the structure of adding, deleting resources and modifying configuration.
The list of currently available knowledge bases is inconsistent with the paging range of the candidate resolution. Knowledge bases outside the parsing window may not be referenced. Changing IDs does not guarantee bypassing this restriction.
Successful response¶
{
"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": "create",
"status": "valid",
"display": {
"agent_name": "产品助手",
"agent_id": "agent_01",
"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 |
|---|---|---|
|
string |
Display type. Fixed to “agent_candidate”. |
|
string |
The workspace and agent identification to which the candidate belongs. |
|
string |
The workspace and agent identification to which the candidate belongs. |
|
string |
Candidate version for subsequent regeneration, validation, or cancellation. |
|
string |
After successful confirmation, it is used to view the version of the loaded agent configuration. |
|
string |
Summary of current candidate content. Subsequent write operations must return this value. |
|
string |
Build modes and candidate states. Value: |
|
string |
Build modes and candidate states. Value: |
|
object |
Display-oriented content candidates, validation diagnostics, and resolved resource references. |
|
string |
agent name. |
|
string |
agent ID. |
|
string |
Release Candidate. |
|
string |
Load version. |
|
string |
model. |
|
array of string or null |
Tool collection. |
|
array of string or null |
Skill set. |
|
array of string or null |
knowledge base reference. |
|
array of object |
Catalog file reference. |
|
string |
The workspace ID to which it belongs. |
|
integer |
Volume ID. |
|
string |
File ID. |
|
array of object |
Channel binding. |
|
string |
Tool name. |
|
string |
Tool source workspace ID. |
|
string |
Skill name. |
|
string |
Skill source workspace ID. |
|
string |
Provider. |
|
string |
The workspace ID to which it belongs. |
|
string |
Channel instance ID. |
|
string |
agentMarkdown text. |
|
string |
Reason for change. |
|
array of object |
Display-oriented content candidates, validation diagnostics, and resolved resource references. At least 1 items. |
|
string |
Diagnostic level. |
|
string |
Error or diagnostic code. |
|
string |
Message content. |
|
string |
Field path. |
|
string |
Resource references. |
|
object |
Display-oriented content candidates, validation diagnostics, and resolved resource references. |
|
object |
model. |
|
string |
Name. |
|
string |
logo. |
|
string |
The workspace ID to which it belongs. |
|
string |
The name when requested. |
|
array of object |
Tool collection. |
|
string |
Name. |
|
string |
logo. |
|
string |
The workspace ID to which it belongs. |
|
string |
The name when requested. |
|
array of object |
Skill set. |
|
string |
Name. |
|
string |
logo. |
|
string |
The workspace ID to which it belongs. |
|
string |
The name when requested. |
|
array of object |
Skill tool mapping. |
|
string |
Skill name. |
|
string |
Skill ID. |
|
string |
Skill source workspace ID. |
|
string |
Tool name. |
|
string |
Tool ID. |
|
string |
Tool source workspace ID. |
|
array of object |
knowledge base reference. |
|
string |
Name. |
|
string |
logo. |
|
string |
The workspace ID to which it belongs. |
|
string |
The name when requested. |
|
array of object |
Catalog file reference. |
|
string |
The workspace ID to which it belongs. |
|
integer |
Volume ID. |
|
string |
File ID. |
|
array of object |
Channel binding. |
|
string |
Tool name. |
|
string |
Tool source workspace ID. |
|
string |
Skill name. |
|
string |
Skill source workspace ID. |
|
string |
Provider. |
|
string |
The workspace ID to which it belongs. |
|
string |
Channel instance ID. |
|
object |
Summary of candidate package files. Return when available. |
|
string |
Manifest file path. |
|
string |
Prompt word file path. |
|
array of string |
List of file paths. |
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors
HTTP status code |
error code |
Description |
|---|---|---|
|
|
The request contains unknown fields, required fields are missing, and the candidate configuration or resource reference is invalid. Recommendation: Fix request based on error message and |
|
|
Valid identity credentials are missing. Recommendation: Check the API Key. |
|
|
The current identity does not have permission to create or modify candidates. Recommendation: Check the workspace and source agent authorization. |
|
|
There are parallel authoring contexts or candidate conflicts for the same agent. Suggestion: Read the current candidate and resubmit. |
|
|
|
|
|
Candidate build failed. Suggestion: Try again later. Contact support if it continues to fail. |
|
|
Agent building or authorization services are temporarily unavailable. Suggestion: Check the current status first. Do not automatically resubmit. |