Skip to main content

RunStepByStepWriting

Writes content in a step-by-step pattern using an outline and summaries.

Operation description

The Quanmiao product supports iframe embedding. For more information, see Customer Onboarding: Quanmiao Public Cloud iframe Customization.

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 Action element 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 Resource element of the policy.
    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.
  • 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

aimiaobi:RunStepByStepWriting

create

*All Resource

*

NoneNone

Request syntax

POST /quanmiao/miaobi/runStepByStepWriting HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

WorkspaceId

string

Yes

The unique ID of the Alibaba Cloud Model Studio workspace. For more information, see Obtain a Workspace ID.

xxxx

Prompt

string

Yes

The prompt.

Prompt

TaskId

string

No

The task ID. You can reuse the same task ID for a multi-turn conversation.

By default, you do not need to specify this parameter. The system automatically generates a task ID. If you specify the same TaskId for subsequent tasks, the tasks are considered part of the same conversation group.

3f7045e099474ba28ceca1b4eb6d6e21

SessionId

string

No

The ID of a single-turn conversation.

3f7045e099474ba28ceca1b4eb6d6e21

OriginSessionId

string

No

The ID of the original conversation when regenerating content.

3f7045e099474ba28ceca1b4eb6d6e21

WritingConfig

object

No

The writing configuration.

Domain

string

No

The writing domain.

  • media (default): Media writing.

  • government: Official document writing.

media

Keywords

array

No

The keywords. This affects article retrieval.

string

No

A keyword (string).

Keyword

PromptTag

object

No

The prompt assistant.

NecessaryTips

string

No

Necessary tips.

Necessary tips

Position

string

No

The position or stance.

Position

ReverseWords

string

No

Reverse the words.

Reverse words

Theme

string

No

The theme.

Theme

Scene

string

No

The step-by-step writing scenario.

  • Scenarios supported for media writing: News Writing (default), News Commentary, and General Style.

  • Scenarios supported for official document writing: Notification (default), Announcement, Bulletin, Request for Instruction, Decision, Letter, and General Style.

News Writing

Step

string

No

The writing step.

  • Generate outline: OutlineGenerate

  • Generate summary: MiniDocSummary

  • Writing (default): Generate article

Writing

Tags

array<object>

No

Control parameters for writing, such as style, length, and output language.

object

No

A tag object.

Keyword

string

No

The value of the option.

10

Tag

string

No

The tag of the option. For example, gcNumberSizeTag=10.

gcNumberSizeTag

UseSearch

boolean

No

Specifies whether to automatically supplement materials.

true

SummaryReturnType

string

No

The return type of the summary result.

  • Structure: Returns a JSON string in payload.output.text. Example format: {"event":"{outline}","message":"{message}"}

  • Content: Returns only the plain text summary content in payload.output.text. Example format: Outline: {outline}\n\n{message}\n\n\n Outline: {outline}\n\n{message}

  • Event: Returns only the outline content itself in payload.output.text each time an outline is completed. Typically, six describes are returned.

Structure

ReferenceData

object

No

The reference article data for writing.

Articles

array<object>

No

The reference article data for writing.

object

No

The reference article data for writing.

Author

string

No

The author.

Author

Content

string

No

The content.

Article content

DocId

string

No

The custom unique ID of the document.

Document - custom unique ID

DocUuid

string

No

The internal unique ID of the document.

8a20e007a6174522af4d6a2657d5526f

MediaUrl

string

No

The URL of the original material.

http://www.example.com

PubTime

string

No

The publication time.

2024-09-10 14:17:54

Source

string

No

The source.

CCTV.com

Summary

string

No

The article summary.

Article summary

Tag

string

No

The tag.

Article tag

Title

string

No

The title.

Article title

Url

string

No

The URL of the article.

https://www.example.com/aaa.docx

MiniDoc

array

No

The ranked article segments for subsequent model generation.

string

No

An article segment.

Article segment

Outlines

array<object>

No

The outline. You can specify a data source to generate the outline.

array<object>

No

An outline.

Articles

array<object>

No

The specified data source for the outline.

object

No

An article object.

Content

string

No

The article content.

Article content

Title

string

No

The article title.

Article title

Url

string

No

The article URL.

Article URL

Outline

string

No

The outline.

Outline

Summarization

array

No

The summary result from the Large Language Model (LLM).

string

No

The summary result (model context).

Summary result (model context)

Response elements

Element

Type

Description

Example

object

BaseLlmResponse

Header

object

The response header.

ErrorCode

string

The error code.

Error code

ErrorMessage

string

The error message.

Error message

Event

string

The Server-Sent Events (SSE) event. `task-started`: The task begins. `task-finished`: The task is complete. `task-failed`: The task failed.

task-started

OriginSessionId

string

The parent session ID.

3f7045e099474ba28ceca1b4eb6d6e21

SessionId

string

The session ID.

3f7045e099474ba28ceca1b4eb6d6e21

TaskId

string

The task ID.

3f7045e099474ba28ceca1b4eb6d6e21

TraceId

string

The full-link trace ID.

Full-link trace ID

Payload

object

The response body.

Output

object

The output.

Articles

array<object>

The reference articles.

object

A reference article.

Author

string

The author.

Author

Content

string

The content.

Article content

DocId

string

The custom unique ID of the document.

Document - custom unique ID

DocUuid

string

The internal unique ID of the document.

f1da53894e784759946d22e2cb2b522a

MediaUrl

string

The URL of the original material.

http://www.example.com

PubTime

string

The publication time.

2024-09-10 14:17:53

Source

string

The source.

CCTV.com

Summary

string

The article summary.

Article summary

Tag

string

The tag.

Article tag

Title

string

The title.

Article title

Url

string

The URL of the article.

https://www.example.com/aaa.docx

ExtraOutput

object

Extra output fields.

summarization

array

The list of summaries. This field is returned when summaries are generated step-by-step.

string

A summary field.

Summary

MiniDoc

array

A list of segments after the article layout has been optimized.

Article segment after fine-grained sorting

string

An article segment after fine-grained sorting.

Article segment after fine-grained sorting

SearchQuery

string

The rewritten query.

LLM changes the world

Text

string

The text generation result.

Text generation result

Usage

object

Information about token usage.

InputTokens

integer

The number of input tokens.

65

OutputTokens

integer

The number of output tokens.

80

TotalTokens

integer

The total number of tokens.

32

RequestId

string

The unique request ID.

3f7045e099474ba28ceca1b4eb6d6e21

Examples

Success response JSON format
{
  "Header": {
    "ErrorCode": "错误码",
    "ErrorMessage": "错误信息",
    "Event": "task-started",
    "OriginSessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "TraceId": "全链路ID"
  },
  "Payload": {
    "Output": {
      "Articles": [
        {
          "Author": "作者",
          "Content": "文章内容",
          "DocId": "文档-自定义的唯一ID",
          "DocUuid": "f1da53894e784759946d22e2cb2b522a",
          "MediaUrl": "http://www.example.com",
          "PubTime": "2024-09-10 14:17:53",
          "Source": "央视网",
          "Summary": "文章摘要",
          "Tag": "文章标签",
          "Title": "文章标题",
          "Url": "https://www.example.com/aaa.docx"
        }
      ],
      "ExtraOutput": {
        "summarization": [
          "摘编"
        ]
      },
      "MiniDoc": [
        "文章精排之后的片段"
      ],
      "SearchQuery": "大模型改变世界",
      "Text": "文本生成结果"
    },
    "Usage": {
      "InputTokens": 65,
      "OutputTokens": 80,
      "TotalTokens": 32
    }
  },
  "RequestId": "3f7045e099474ba28ceca1b4eb6d6e21"
}

Error codes

HTTP status code

Error code

Error message

Description

403NoPermissionYou are not authorized to perform this action.Please check the workspaceId assignment
See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.
Token Plan
Model Playground
  • 3D model generation
  • Audio generation
Fine-tuning
Model Compression
Statistics and Monitoring
Support