RunWriting

Updated at:

Direct writing.

Operation description

This API is deprecated. For more information, see RunWritingV2.

The Quanmiao product supports iframe embedding. For more information, see Customer integration: 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:RunWriting

create

*All Resource

*

NoneNone

Request syntax

POST /quanmiao/aimiaobi/runWriting 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 Get a Workspace ID.

xxxx

Prompt

string

Yes

The prompt.

提示词

TaskId

string

No

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

You do not need to specify TaskId. The system generates one automatically. If you use the same TaskId for multiple tasks, they are grouped into a single conversation.

3f7045e099474ba28ceca1b4eb6d6e21

SessionId

string

No

The ID of a single-turn conversation.

3f7045e099474ba28ceca1b4eb6d6e21

OriginSessionId

string

No

The ID of the original conversation to use for regeneration.

3f7045e099474ba28ceca1b4eb6d6e21

WritingConfig

object

No

The writing configuration.

Domain

string

No

The writing domain.

  • media: Media

  • government: Government

  • market: Marketing

media

PromptTag

object

No

The prompt assistant.

NecessaryTips

string

No

Necessary tips.

必要提示

Position

string

No

The stance.

立场

ReverseWords

string

No

Negative keywords.

反向词

Theme

string

No

The theme.

主题

Tags

array<object>

No

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

object

No

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

Keyword

string

No

The value of the option.

10

Tag

string

No

The tag of the option. Example: gcNumberSizeTag=10.

gcNumberSizeTag

UseSearch

boolean

No

Specifies whether to automatically add reference materials.

true

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.

作者

Content

string

No

The content.

文章内容

DocId

string

No

The custom unique ID of the document.

文档-自定义的唯一ID

DocUuid

string

No

The internal unique ID of the document.

2124ca4d48a542d788aa86151e1a8c8b

PubTime

string

No

The publication time.

2024-08-28 11:38:28

Source

string

No

The source.

央视网

Summary

string

No

The article summary.

文章摘要

Tag

string

No

The tag.

文章标签

Title

string

No

The title.

文章标题

Url

string

No

The URL of the article.

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

Response elements

Element

Type

Description

Example

object

BaseLlmResponse

Header

object

The response header.

ErrorCode

string

The error code.

错误码

ErrorMessage

string

The error message.

错误信息

Event

string

The Server-Sent Events (SSE) event. Valid values: task-started (the task starts), task-finished (the task is complete), and task-failed (the task failed).

task-started

OriginSessionId

string

The parent session ID.

3f7045e099474ba28ceca1b4eb6d6e21

SessionId

string

The session ID.

3f7045e099474ba28ceca1b4eb6d6e21

StatusCode

integer

The HTTP status code.

400

TaskId

string

The task ID.

3f7045e099474ba28ceca1b4eb6d6e21

TraceId

string

The trace ID.

全链路ID

Payload

object

The response body.

Output

object

The output.

Articles

array<object>

The reference articles.

object

A reference article.

Author

string

The author.

作者

Content

string

The content.

文章内容

DocId

string

The custom unique ID of the document.

文档-自定义的唯一ID

DocUuid

string

The internal unique ID of the document.

98229f6001cf4deeb1668191d4eccc75

PubTime

string

The publication time.

2024-08-28 11:38:28

Source

string

The source.

央视网

Summary

string

The article summary.

文章摘要

Tag

string

The tag.

文章标签

Title

string

The title.

文章标题

Url

string

The URL of the article.

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

MiniDoc

array

A list of refined segments from the article.

文章精排之后的片段

string

A refined segment from the article. *

文章精排之后的片段

SearchQuery

string

The rewritten query.

大模型改变世界

Text

string

The generated text.

文本生成结果

Usage

object

The token usage.

InputTokens

integer

The number of tokens used for the input.

1

OutputTokens

integer

The number of tokens used for the output.

1

TokenMap

object

The detailed token usage.

integer

The detailed token usage.

44

TotalTokens

integer

The total number of tokens used in the current call.

2

RequestId

string

The request ID.

3f7045e099474ba28ceca1b4eb6d6e21

End

boolean

Indicates whether the current request is complete.

true

Examples

Success response

JSON format

{
  "Header": {
    "ErrorCode": "错误码",
    "ErrorMessage": "错误信息",
    "Event": "task-started",
    "OriginSessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "SessionId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "StatusCode": 400,
    "TaskId": "3f7045e099474ba28ceca1b4eb6d6e21",
    "TraceId": "全链路ID"
  },
  "Payload": {
    "Output": {
      "Articles": [
        {
          "Author": "作者",
          "Content": "文章内容",
          "DocId": "文档-自定义的唯一ID",
          "DocUuid": "98229f6001cf4deeb1668191d4eccc75",
          "PubTime": "2024-08-28 11:38:28",
          "Source": "央视网",
          "Summary": "文章摘要",
          "Tag": "文章标签",
          "Title": "文章标题",
          "Url": "https://www.example.com/aaa.docx"
        }
      ],
      "MiniDoc": [
        "文章精排之后的片段"
      ],
      "SearchQuery": "大模型改变世界",
      "Text": "文本生成结果"
    },
    "Usage": {
      "InputTokens": 1,
      "OutputTokens": 1,
      "TokenMap": {
        "key": 44
      },
      "TotalTokens": 2
    }
  },
  "RequestId": "3f7045e099474ba28ceca1b4eb6d6e21",
  "End": true
}

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.