Skip to main content

RunScriptRefine

Refines the content of a playbook conversation.

Debug

You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful call, OpenAPI Explorer can automatically generate SDK code examples. Debug

Authorization information

The following table describes the authorization information for this API. You can use it in the Action element of RAM permission policy statements to grant RAM users or RAM roles the permission to call this API. For more information:
  • Action: The specific permission.
  • Access level: The access level of each operation. Valid values: Write, Read, or List.
  • Resource type: The resource types supported for authorization in the operation. For more information:
    • For required resource types, an asterisk (*) prefix is used.
    • For operations that do not support resource-level authorization, All resources is used.
  • Condition key: The condition keys defined by the cloud service.
  • Dependent action: The other permissions required to successfully perform the operation. The caller must have the permissions of all dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
quanmiaolightapp:RunScriptRefinenone
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/quanmiao/lightapp/runScriptRefine HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample value
workspaceIdstringYes

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

llm-zna577pdximvztk5
taskIdstringNo

The unique identifier of the task

Note
  • You do not need to specify taskId by default. The system generates one automatically. If the same taskId is specified for subsequent tasks, the tasks belong to the same conversation.
  • We recommend that you manually assign a taskId to associate context.
  • a3d1c2ac-f086-4a21-9069-f5631542f5a2

    Response parameters

    ParameterTypeDescriptionExample value
    object

    Schema of Response

    endboolean

    Indicates whether the output is complete. A value of true indicates that the output is complete.

    headerobject

    The header of the streaming output, which contains common response information

    errorCodestring

    The error code

    403
    errorMessagestring

    The error message

    Pop sign mismatch, please check log.
    eventstring

    The event type

    result-generated
    eventInfostring

    The event description

    Model generation event
    requestIdstring

    The request ID

    F8A35034-EDCF-5C50-95A5-1044316F36E3
    sessionIdstring

    The session ID

    17dc8bcd-f34a-46d1-a7a3-0fa3d1ce3824
    taskIdstring

    The ID of a generation task

    14356391-6c6c-40d5-b80a-8ecd03b69d72
    traceIdstring

    The trace ID

    2150432017236011824686132ecdbc
    payloadobject

    The payload of the response, in JSON format. The structure varies by event

    outputobject

    The output content object

    textstring

    The output content

    xx
    rolestring

    The role identity

    User role information
    scenestring

    The story scene. This is a reserved field

    Reserved field, no value assigned
    summarystring

    The story synopsis

    In a metropolis full of opportunities and challenges, an ordinary girl Lin Su harbors dreams but hits walls everywhere. A chance encounter
    outlinestring

    The script outline

    On a night in the bustling city, Lin Su, feeling down after a failed interview, accidentally bumps into Shen Yi
    contentarray<object>

    The body content

    contentobject

    The body content

    string

    The body content. The content of an act

    {"Act 1":" Act number: Act 1\n\n Scene description"}
    usageobject

    The token usage of the Large Language Model (LLM)

    inputTokenslong

    The number of input tokens

    100
    outputTokenslong

    The number of output tokens

    100
    totalTokenslong

    The total number of tokens

    200

    Examples

    Normal response example JSON format
    {
      "end": true,
      "header": {
        "errorCode": 403,
        "errorMessage": "Pop sign mismatch, please check log.",
        "event": "result-generated",
        "eventInfo": "模型生成事件",
        "requestId": "F8A35034-EDCF-5C50-95A5-1044316F36E3",
        "sessionId": "17dc8bcd-f34a-46d1-a7a3-0fa3d1ce3824",
        "taskId": "14356391-6c6c-40d5-b80a-8ecd03b69d72",
        "traceId": "2150432017236011824686132ecdbc"
      },
      "payload": {
        "output": {
          "text": "xx",
          "role": "用户角色信息",
          "scene": "保留字段,暂无赋值",
          "summary": "在充满机遇与挑战的大都市,平凡女孩林苏怀揣梦想却处处碰壁。一次偶然的机会",
          "outline": "在繁华都市的夜晚,林苏因面试失败心情低落时意外撞上了沈逸",
          "content": [
            {
              "key": {
                "第一幕": " 幕次: 第一幕\n\n 场面描述"
              }
            }
          ]
        },
        "usage": {
          "inputTokens": 100,
          "outputTokens": 100,
          "totalTokens": 200
        }
      }
    }
    

    Error codes

    HTTP status codeError codeError messageDescription
    403NoPermissionYou are not authorized to perform this action , Please check the assignment of the workspaceId.Check the workspaceId assignment
    Visit the Error Center to view more error codes.