RunStyleWriting
Learn the styles and formats for media and retail content.
Try it now
Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.
RAM authorization
The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:
-
Action: The actions can be used in the
Actionelement of RAM permission policy statements to grant permissions to perform the operation. -
API: The API that you can call to perform the action.
-
Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.
-
Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
Resourceelement of the policy. - For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the
Resourceelement of the policy.
- For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the
-
Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.
-
Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.
Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
quanmiaolightapp:RunStyleWriting | none | *All Resource
| None | None |
Request syntax
POST /{workspaceId}/quanmiao/lightapp/runStyleWriting HTTP/1.1
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | llm-2setzb9xb8mx |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| learningSamples | array | No | A collection of articles to use as learning samples. | ["In this fast-paced era, words seem to have become a luxury of slow living. But do you still remember how those gentle phrases quietly slipped into your heart, stirring up long-lost ripples? Today, let us step into the world of [Miaobi Writing] together, explore the secrets that make words leap off the page, and let inspiration dance lightly at our fingertips, blooming with unique brilliance. "] |
string | No | An article to use as a learning sample. | In this fast-paced era, words seem to have become a luxury of slow living. But do you still remember how those gentle phrases quietly slipped into your heart, stirring up long-lost ripples? Today, let us step into the world of [Miaobi Writing] together, explore the secrets that make words leap off the page, and let inspiration dance lightly at our fingertips, blooming with unique brilliance. | |
| writingTheme | string | No | The theme for the generated content. Providing a custom theme helps fine-tune the output. | Help me write copy about the Miaobi product |
| styleFeature | string | No | The style feature identifier. When specified, the API generates content based on this feature. | Feature 1: Titles adopt hashtag format to enhance social media reach.\nFeature 2: The opening uses a quote to briefly set the background, quickly connecting to current trending topics.\nFeature 3: Uses journalistic investigation as support, listing specific industry examples to strengthen the realistic foundation of the argument.\nFeature 4: Introduces legal viewpoints to balance the argument, provides policy basis, and advocates positive values.\n\nSummary of example article features: This article is driven by social hotspots, uses a communicable title design, introduces the topic through phenomenon observation, combines field investigation data to present broad social phenomena, cites legal provisions for commentary to ensure objectivity, and advocates positive and healthy workplace culture at the conclusion. The overall structure is compact, information-rich, and guiding. |
| referenceMaterials | array | No | A collection of reference materials for the large model's content generation. | do you still remember how those gentle phrases quietly slipped into your heart, stirring up long-lost ripples? Today, let us step into the world of [Miaobi Writing] together, explore the secrets that make words leap off the page, and let inspiration dance lightly at our fingertips, blooming with unique brilliance. "] |
string | No | A reference material for the large model's content generation. | In this fast-paced era, words seem to have become a luxury of slow living. But do you still remember how those gentle phrases quietly slipped into your heart, stirring up long-lost ripples? Today, let us step into the world of [Miaobi Writing] together, explore the secrets that make words leap off the page, and let inspiration dance lightly at our fingertips, blooming with unique brilliance. | |
| processStage | string | No |
| |
| useSearch | boolean | No | Specifies whether to automatically search the internet for additional reference materials. |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Response schema | ||
| end | boolean | Indicates whether the output is complete. A value of | true |
| header | object | The header of the streaming output, containing common response metadata. | {"event":"task-progress-start-generating","sessionId":"3cd10828-0e42-471c-8f1a-931cde20b035","taskId":"d3be9981-ca2d-4e17-bf31-1c0a628e9f99","traceId":"66bef4a7f5d61ff3c43f3b710574e175"} |
| errorCode | string | A unique code that identifies the error. | 403 |
| errorMessage | string | A human-readable message that describes the error. | Pop sign mismatch, please check log. |
| event | string | The event type. | task-progress-start-generating |
| eventInfo | string | The event description. | Model generation event |
| requestId | string | The unique ID for the request, useful for troubleshooting. | 0EB27AE3-CA53-5FAE-83C6-EE66CA4DF5DF |
| sessionId | string | The session ID for this conversation. | 3cd10828-0e42-471c-8f1a-931cde20b035 |
| taskId | string | The task ID for this generation job. | d3be9981-ca2d-4e17-bf31-1c0a628e9f99 |
| traceId | string | The trace ID for distributed tracing. | 2150451a17191950923411783e2927 |
| payload | object | The response payload. Its schema depends on the | { "output": { "text": "This is test output" }, "usage": { "inputTokens": 1816, "outputTokens": 96, "totalTokens": 1912 } } |
| output | object | Contains the generated content. | { "text": "This is test output" } |
| text | string | The generated text content. | This is test output |
| usage | object | Token usage statistics for the model call. | { "inputTokens": 1816, "outputTokens": 96, "totalTokens": 1912 } |
| inputTokens | integer | The number of tokens in the prompt. | 100 |
| outputTokens | integer | The number of tokens in the generated output. | 100 |
| totalTokens | integer | The total number of tokens used in the request (input + output). | 200 |
Examples
Success response
JSON format
{
"end": true,
"header": {
"errorCode": "403",
"errorMessage": "Pop sign mismatch, please check log.",
"event": "task-progress-start-generating",
"eventInfo": "模型生成事件",
"requestId": "0EB27AE3-CA53-5FAE-83C6-EE66CA4DF5DF",
"sessionId": "3cd10828-0e42-471c-8f1a-931cde20b035",
"taskId": "d3be9981-ca2d-4e17-bf31-1c0a628e9f99",
"traceId": "2150451a17191950923411783e2927"
},
"payload": {
"output": {
"text": "这是测试输出"
},
"usage": {
"inputTokens": 100,
"outputTokens": 100,
"totalTokens": 200
}
}
}
Error codes
HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 403 | NoPermission | You are not authorized to perform this action , Please check the assignment of the workspaceId. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.