Table Q&A (General)

Updated at:

Table Q&A (Premium Edition - General realm)

Usage notes

  • This is a Premium Edition feature. To use this service for free, you must activate the Premium Edition. You can check your activation status here: Check activation status

  • To obtain the required `bot_id` parameter, you must first call the Query service information by service ID API. For more information, see Query service information by service ID.

  • Supported realm: General

  • Description: TableQA is a Q&A pair engine that lets you build chatbots at a low cost based on business tables.

Request parameters

Name

Type

Required

Example value

Description

Action

String

Yes

RequestTableQAOnline

A required parameter. The value is RequestTableQAOnline.

ServiceCode

String

Yes

alinlp

A static field. Only `alinlp` is supported.

Params

String

Yes

{"bot_id":"5e7ff849-d411-47f6-a0a2-ab6186eb4893","question":"What was yesterday's fund code?"}

  • bot_id: The robot ID.

  • question: The question to ask.

Returned data

Name

Type

Sample value

Description

RequestId

String

D85FE2F3-C75C-130C-9FCE-2BC502E2D210

The unique ID of the request. Use this ID to troubleshoot issues.

Data

String

{
    "bot_id":"f7b2cefc-157e-4a57-9364-9d8fd22500a1",
    "display_data":null,
    "display_strategy":{},
    "error_info":"None",
    "msg":"The request was successful.",
    "msql":[],
    "question":"What was yesterday's fund code?",
    "related_question":[
    ],
    "response_nlg":"",
    "score":0.8450704225352114,
    "session_id":"",
    "sql":{},
    "sql_data":null,
    "status":200,
    "themes":[]
}
  • msql: The result detected by the model.

  • question: The question.

  • score: The score.

  • sql: The parsed SQL object.

API integration

  1. For information about code-based integration, see Quick Start.

Table Q&A service error messages

If an error occurs during a call, refer to the following table. Use the descriptions to resolve the issue.

Status

Message

Description

400

IdError: Missing parameter bot_id

The bot_id parameter is missing.

400

QuestionError: Missing parameter question

The question parameter is missing.

400

ServiceError: Service bot info not configured.

The bot configuration is incomplete.

400

TableError: Table not configured in this service or link not found.

The table is incorrectly configured.

400

TableIdError: The specified table cannot be queried.

An error occurred when querying the specified table.

500

InternalError: Internal model error.

A model connection error occurred.

500

InternalError: msql to sql transformation error.

An error occurred when transforming the SQL object.

500

InternalError: Error executing SQL.

An error occurred when transforming the SQL statement.

500

InternalError: Internal SQL service error.

An unknown error occurred.

Error codes

If an error occurs during a call, refer to the following table for the cause of the error and the solution.

HTTP status code

Error code

Error message

Description

400

UserStatusInvalid

The user status is invalid.

The user status is invalid. Check if your account has an overdue payment or an unpaid bill.

400

BasicServiceNotActivated

The NLP API (Version : base) service has not been activated. Please click the url to confirm the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpBasePost_public_cn#/buy

The NLP API (Basic Plan) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpBasePost_public_cn#/buy

400

AdvancedServiceNotActivated

The NLP API (Version : advanced) service has not been activated. Please click the url to confirm the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpAdvancedPost_public_cn#/buy

The NLP API (Premium Edition) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpAdvancedPost_public_cn#/buy

400

IndustryServiceNotActivated

The NLP API (Version : industry) service has not been activated. Please click the url to confirm the activation status:https://common-buy.aliyun.com/?commodityCode=nlp_alinlpIndustryPost_public_cn#/buy

The NLP API (Industry Application Edition) service is not activated. Click the link to check the activation status: https://common-buy.aliyun.com/?commodityCode=nlp_alinlpIndustryPost_public_cn#/buy

401

InvalidParameter

The parameter is invalid.

The parameter is invalid. Check the request parameters.

403

Forbidden.NoAuth

You are not authorized to operate on the specified resource. Please click the URL for help information:https://help.aliyun.com/document_detail/177209.html

You are not authorized to operate on the specified resource. Click the URL for help: https://help.aliyun.com/document_detail/177209.html

405

TextLimitExceeded

The maximum length of the text is exceeded.

The text length exceeds the limit.

406

TextCodingError

An encoding error occurred to the input text.

An encoding error occurred in the input text.

410

FrameworkError

Framework internal server error.

A framework error occurred.

411

FrameworkApiError

Framework API error.

A framework API error occurred.

412

FrameworkFormatError

Framework request format error.

The framework request format is invalid.

413

FrameworkReturnError

Framework return type format error.

The framework response format is invalid.

429

Throttling.User

Flow control has been triggered.

The number of queries per second (QPS) exceeds the limit. Click the URL for help: https://help.aliyun.com/document_detail/69780.html#p-wq5-zb9-5wu

500

InternalError

A server error occurred while processing your request. Please try again later or contact customer support.

A server error occurred while processing your request. Try again later or contact customer support.

Visit Error Center for more error codes.