RunDeepWriting
Queries deep writing events. The system returns detailed information about the task execution as a stream of Server-Sent Events (SSE).
Try it now
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After the call succeeds, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
The following table describes the authorization information of the API. You can use it in the Action element of a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. For more information, see the following:
-
Action: the specific permission point.
-
Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization in the operation. For more information, see the following:
- Required resource types are marked with a leading *.
- For operations that do not support resource-level authorization,
All resourcesis used.
-
Condition key: the condition keys defined by the cloud service itself.
-
Dependent action: the other permissions required to successfully perform the operation. The caller must have the permissions of the dependent actions at the same time for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| aimiaobi:RunDeepWriting | create | *All resources * |
| None |
Request syntax
POST /pop/deepWrite/runDeepWriting HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| WorkspaceId | string | Yes | The unique identifier of the Alibaba Cloud Model Studio workspace: Workspace ID | llm-ir8zkqry2fncaxwq |
| TaskId | string | No | The task ID. | 95c2fbe6-5a20-4fc2-8a93-376ed05fbe13 |
| Cursor | integer | No | The cursor, which is the ordinal number of the streaming event. | 10 |
Response elements
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| Header | object | The response header. | |
| ErrorCode | string | The error code. | 403 |
| ErrorMessage | string | The error message. | Error message |
| Event | string | The Server-Sent Event (SSE). Valid values:
| response.output_item.done |
| SessionId | string | The session ID. | c2e2e991-f96a-4fcc-9ff7-d0df46c6d232 |
| StatusCode | integer | The HTTP response code. | 200 |
| TaskId | string | The task ID. | b84d31a5-44b2-4a35-9c6d-878d459c93d0 |
| TraceId | string | The trace ID. | FAB10D42-F081-557B-8DCB-D6FB7AAF100B |
| Payload | object | The response body. | |
| Output | object | The output. | |
| Type | string | The type. | Same as the parent Event |
| SequenceNumber | string | The ordinal number of the streaming event. | 1 |
| OutputIndex | integer | The ordinal number of the new output item in this event. | 1 |
| Response | object | The response body. | |
| Id | string | The unique ID of the task. | b2dc224b38694e0b668020159a7c5732 |
| Status | string | The execution status of the task. Valid values:
| in_progress |
| Item | object | The new output item for this event. | |
| Id | string | The unique ID of the item. | 88f6ed9e85c4f9377378da23e6a370d1 |
| Status | string | The status of the item. Valid values:
| completed |
| Type | string | The type of the item. Valid values:
| function_call |
| Arguments | string | The parameters. | This field has a value when the item type is function_call. It is the input parameter of the function being called. |
| Name | string | The parameter name. | This field has a value when the item type is function_call. It is the name of the function being called. |
| Result | string | The result of the item. | This field has a value when the item type is function_call. It is the output of the function being called. |
| Agent | string | The name of the agent that outputs this item. | ProjectManager |
| Content | array<object> | This field has a value when the item type is message. It is a list of output content. | |
| content | object | The text content. | |
| Type | string | When the item type is message, the value of this field is output_text. | output_text |
| Text | string | The text content that is output when the item type is message. | <TASK_DONE> |
| RequestId | string | The unique request ID. | 31AC01F1-88FB-5C4D-B6F5-E8BB136CD5A3 |
| HttpStatusCode | string | The HTTP response code. | 200 |
| Code | string | The status code. | successful |
| Message | string | The error message. | success |
| Success | boolean | Indicates whether the request was successful. | true |
Examples
Success response
JSON format
{
"Header": {
"ErrorCode": 403,
"ErrorMessage": "错误消息",
"Event": "response.output_item.done",
"SessionId": "c2e2e991-f96a-4fcc-9ff7-d0df46c6d232",
"StatusCode": 200,
"TaskId": "b84d31a5-44b2-4a35-9c6d-878d459c93d0",
"TraceId": "FAB10D42-F081-557B-8DCB-D6FB7AAF100B"
},
"Payload": {
"Output": {
"Type": "同上级Event",
"SequenceNumber": 1,
"OutputIndex": 1,
"Response": {
"Id": "b2dc224b38694e0b668020159a7c5732",
"Status": "in_progress"
},
"Item": {
"Id": "88f6ed9e85c4f9377378da23e6a370d1",
"Status": "completed",
"Type": "function_call",
"Arguments": "item类型为function_call时,此字段有值,为调用函数的入参",
"Name": "item类型为function_call时,此字段有值,为调用的函数名字",
"Result": "item类型为function_call时,此字段有值,为调用的函数的输出",
"Agent": "ProjectManager",
"Content": [
{
"Type": "output_text",
"Text": "<TASK_DONE>"
}
]
}
}
},
"RequestId": "31AC01F1-88FB-5C4D-B6F5-E8BB136CD5A3",
"HttpStatusCode": 200,
"Code": "successful",
"Message": "success",
"Success": true
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action. | Please check the workspaceId assignment |
For more error codes, visit Error Center.