GenDocQaResult

Updated at:

Parses question and answer (Q&A) pairs from a document. You can use the UpdateQaLibrary API to update the Q&A pairs.

Operation description

Before you use this API, make sure you understand the billing methods and pricing of the Tongyi Dianjin product.

Prerequisites

You have activated Alibaba Cloud Model Studio and the Tongyi Dianjin service.

Obtain the workspaceId: Obtain the workspace identifier.

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

Authorization information

The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles the permission to call this API. Details are as follows:

  • 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 are as follows:

    • For required resource types, an asterisk (*) is added as a prefix.
    • For actions that do not support resource-level authorization, All resources is used.
  • Condition key: the condition keys defined by the cloud service itself.

  • Related action: other permissions required to successfully perform the action. The caller must also have the permissions of the related actions for the operation to succeed.

ActionAccess levelResource typeCondition keyRelated action
dianjin:GenDocQaResultcreate
*All resources
*
    None
None

Request syntax

POST /{workspaceId}/api/virtualHuman/qa/parse HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
workspaceIdstringYes

The workspace ID.

llm-xxxxx
bodyobjectNo

The request body.

docIdstringYes

The document ID.

182364872346
libraryIdstringYes

The document library ID.

sjdgdsfg
requestIdstringYes

The request ID. The request ID serves as the unique identifier of the request. The first request initiates the Q&A parsing. Subsequent requests with the same request ID query the parsing status and results.

0FC6636E-380A-5369-AE01-D1C15BB9B254

Response parameters

NameTypeDescriptionExample value
object

The Q&A pair.

successboolean

Indicates whether the request was successful.

true
dataTypestring

The data type.

null
timestring

The timestamp.

2024-04-24 11:54:34
errCodestring

The error code.

0
messagestring

The error message.

ok
dataobject

The response data.

libraryIdstring

The document library ID.

7wxwrjpabj
docIdstring

The document ID.

873648346573245
currentStatusstring

The current status[INIT (initialization),PROCESSING (in progress),COMPLETED (completed),FAIL (failed)]

PROCESSING
parseQaResultsarray<object>

The Q&A results of the parsing.

parseQaResultobject
questionstring

The question.

今天的天气怎么样?
answerstring

The answer.

今天的天气不错,多云转晴。
requestIdstring

The request ID.

44BD277A-87F9-5310-8D63-3E6645F1DA85
costlong

The time consumed.

null

Examples

Success response

JSON format

{
  "success": true,
  "dataType": null,
  "time": "2024-04-24 11:54:34",
  "errCode": 0,
  "message": "ok",
  "data": {
    "libraryId": "7wxwrjpabj",
    "docId": 873648346573245,
    "currentStatus": "PROCESSING",
    "parseQaResults": [
      {
        "question": "今天的天气怎么样?",
        "answer": "今天的天气不错,多云转晴。\n"
      }
    ]
  },
  "requestId": "44BD277A-87F9-5310-8D63-3E6645F1DA85",
  "cost": 0
}

Error codes

Visit the Error Center to view more error codes.

Change history

Change timeChange summaryOperation

No change history yet.