Skip to main content

RunScriptChat

Create long-form scripts.

Debug

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

RAM authorization

The following table describes the authorization information for this API. You can use the Action element in a RAM permission policy statement to grant RAM users or RAM roles the permission to call this API. Details:
  • Action: The specific permission point.
  • Access level: The access level of each action. Valid values: Write, Read, or List.
  • Resource type: The resource types that support authorization for the action. Details:
    • Required resource types are marked with a leading asterisk (*).
    • For actions that do not support resource-level authorization, All resources is used.
  • Condition key: The condition keys defined by the cloud service itself.
  • Dependent action: Other permissions required to successfully perform the action. The caller must also have the permissions of the dependent actions for the operation to succeed.
ActionAccess levelResource typeCondition keyDependent action
quanmiaolightapp:RunScriptChatnone
*All resources
*
    None
None

Request syntax

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

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

Unique identifier of the Alibaba Cloud Model Studio workspace. To get this ID, see Workspace ID.

llm-rz8db8d00rcn2p0xc
promptstringYes

Script instruction entered by the user.

Create character: Lin Xiaoxiao
taskIdstringNo

Unique identifier of the task.

Note
  • By default, you do not need to specify taskId, and the system generates it automatically. If subsequent tasks use the same taskId, those tasks belong to the same conversation.
  • We recommend that you manually assign a taskId to maintain context.
  • a3d1c2ac-f086-4a21-9069-f5631542f5a2

    Response elements

    ElementTypeDescriptionExample
    object

    Schema of Response

    endboolean

    Whether the output is complete. true indicates that the output is complete.

    true
    headerobject

    Header for streaming output, which contains general response information.

    errorCodestring

    Error code for exceptions.

    403
    errorMessagestring

    Error message for exceptions.

    Pop sign mismatch, please check log.
    eventstring

    Event type.

    result-generated
    eventInfostring

    Event description.

    Model generation event description
    requestIdstring

    Request ID.

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

    Session ID.

    147648697127_914847410985_1730600302167
    taskIdstring

    Generation task ID.

    d3be9981-ca2d-4e17-bf31-1c0a628e9f99
    traceIdstring

    Trace ID.

    2150432017236011824686132ecdbc
    payloadobject

    Payload of the response, in JSON structure.

    outputobject

    Output content object.

    textstring

    Output content.

    The following is character information
    usageobject

    LLM token usage information.

    inputTokenslong

    Number of input tokens.

    100
    outputTokenslong

    Number of output tokens.

    100
    totalTokenslong

    Total number of tokens.

    200

    Examples

    Success response 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": "147648697127_914847410985_1730600302167",
        "taskId": "d3be9981-ca2d-4e17-bf31-1c0a628e9f99",
        "traceId": "2150432017236011824686132ecdbc"
      },
      "payload": {
        "output": {
          "text": "以下是角色信息"
        },
        "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 assignment of the workspaceId.
    Visit the Error Center for more error codes.