Streaming polishing skill draft¶
Submit a skill draft and receive polishing events sent by the server. The resulting event contains saveable skill content.
POST $CLOUDSIGMA_API_BASE/workspaces/{workspace_id}/skills/polish/stream
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.
Prepare personal access token, workspace ID and skills draft to be polished. The response type is text/event-stream.
Request body¶
curl -N -X POST "$CLOUDSIGMA_API_BASE/workspaces/$WORKSPACE_ID/skills/polish/stream" \
-H "X-API-Key: $CLOUDSIGMA_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID" \
-H 'Content-Type: application/json' \
-d '{
"name": "摘要",
"description": "生成内容摘要",
"instruction": "总结输入内容"
}'
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
string |
Yes |
Skill name. |
|
string |
Yes |
Skill instructions to be polished. |
|
string |
Yes |
Skill Description. |
|
object |
No |
Structured skill instruction. |
|
string |
No |
This field is ignored by the current interface. Please fill in |
|
object |
No |
JSON Schema of directive variables. |
|
string |
No |
Enter the requirements. |
|
string |
No |
Output format. |
|
string |
No |
Skill classification. |
|
array of string |
No |
Skill tag. |
|
string |
No |
Skill stage. |
|
array of string |
No |
Pipeline steps. |
|
string |
No |
Pipeline reference. |
|
string |
No |
Skill source type. |
|
string |
No |
Skill source reference. |
|
object |
No |
Route summary. |
|
object |
No |
Skill dependent requirements. |
|
object |
No |
JSON Schema of the input parameters. |
|
object |
No |
Output format convention. |
|
object |
No |
String label. |
|
object |
No |
String annotation. |
|
object |
No |
Extended metadata. |
Successful response¶
event: started
data: {"request_id":"req_01","prompt_version":"skill_polish_v1"}
event: delta
data: {"request_id":"req_01","content":"请总结输入内容"}
event: ping
data: {"request_id":"req_01","timestamp":"2026-08-21T07:00:00Z"}
event: result
data: {"request_id":"req_01","result":{"name":"摘要","description":"摘要技能","instruction":"请总结输入内容","instruction_spec":{"body":"请总结输入内容"},"routing_summary":{},"requirements":{},"tags":[]}}
event: error
data: {"request_id":"req_01","error":{"code":"INVALID_DRAFT","message":"The skill draft is invalid.","retryable":false}}
event: done
data: {"request_id":"req_01"}
Returns the event stream on success. Each event consists of the event: line, the data: line of a single line of JSON, and a blank line. The result event contains the verified skill draft, and done indicates the end of the flow.
Common fields
Field |
Type |
Description |
|---|---|---|
|
string |
The event type in the |
|
string |
ID of this polish request. |
start event
Field |
Type |
Description |
|---|---|---|
|
string |
The prompt word version in the |
Increment and heartbeat
Field |
Type |
Description |
|---|---|---|
|
string |
Incremental text in the |
|
string |
RFC 3339 time in |
Generate results
Field |
Type |
Description |
|---|---|---|
|
object |
Verified skill draft in event |
|
string |
Skill name. |
|
string |
Skill Description. |
|
string |
Polished skill instructions. |
|
object |
Structured skill instructions, the text is the same as |
|
string |
Enter the requirements. Does not return if not set. |
|
string |
Output format. Does not return if not set. |
|
string |
Skill classification. Does not return if not set. |
|
array of string |
Skill tag. |
|
string |
Skill stage. Does not return if not set. |
|
array of string |
Pipeline steps. Does not return if not set. |
|
string |
Pipeline reference. Does not return if not set. |
|
string |
Skill source type. Does not return if not set. |
|
string |
Skill source reference. Does not return if not set. |
|
object |
Route summary object, which can be an empty object. |
|
object |
Skill dependent object, which can be an empty object. |
|
object |
JSON Schema of the input parameters. Does not return if not set. |
|
object |
Output format convention. Does not return if not set. |
|
object |
String label. Does not return if not set. |
|
object |
String annotation. Does not return if not set. |
|
object |
Extended metadata. Does not return if not set. |
|
array of string |
Things still to be confirmed. Do not return if not. |
|
array of string |
Polishing warning. Do not return if not. |
error event
Field |
Type |
Description |
|---|---|---|
|
object |
Public error message in event |
|
string |
In-stream error code. |
|
string |
In-stream error description. |
|
boolean |
Is it possible to try again. |
Error response¶
Before establishing the event stream, permission denial returns HTTP 403, code=5. Unable to establish event stream or unknown internal error returned HTTP 500, code=13. After the event stream is established, the error and end events in the stream should be read, and success cannot be determined based on HTTP 200 alone.
event: error
data: {"request_id":"req_01","error":{"code":"INVALID_DRAFT","message":"The skill draft is invalid.","retryable":false}}
event: done
data: {"request_id":"req_01"}
{
"code": 2,
"message": "invalid argument"
}
After the stream has started, a processing error is returned via the SSE error event, followed by done:
Request errors before the stream is established with a plain JSON response:
Common fields
HTTP status code |
error code |
Description |
|---|---|---|
|
|
Common reasons: The JSON is invalid, or the skill draft fails the verification before establishing the event stream. Recommended Action: Check the request body and required fields. |
|
|
Common reasons: The skill polish service is not configured. Recommended Action: Try again later. |