You need to enable JavaScript to run this app.
DataAgent (OnPremise)

DataAgent (OnPremise)

Copy page
Download PDF
Intelligent Data Analysis
Obtain Available Analysis Capabilities
Copy page
Download PDF
Obtain Available Analysis Capabilities

After obtaining the basic query result, you need to use this API to first determine which intelligent analysis capabilities (Insight Ability) are available for the current data query result.

Prerequisites

The Intelligent Analysis Agent provides you with an OpenAPI interface for advanced data analysis. You can call this API to perform advanced analyses such as attribution analysis and anomaly analysis on data query results.

  • Before performing advanced analysis, you need to initiate a data query to obtain the historyId and sessionId of the data query result. When using the advanced data analysis API, you must specify the data query result to be analyzed by providing either the historyId or sessionId in the request parameters.
  • It is recommended to use the new version of the WenShu API when initiating a data query:
    • After creating a session, you can obtain the corresponding sessionId for the session. For details, see Create a Session.
    • The data query result is returned in a streaming manner via the chat completion API. When the event stream has type=result and status=success, the result field in the event contains the historyId of the query result. For details, see Session Completion.

Request description
  • Request method: GET
  • Request URL: {domain}/dataAgent/llm/openApi/v2/agent/insightAbilities

Request parameters

Parameter

Type

Required

Example value

Description

historyId

int

Yes

12886163

The session result ID for this instance. For example, when a vague question is broken down into multiple sub-questions for querying, each sub-question result will have a session result ID.
For example, when using the new version of the WenShu OpenAPI, you need to configure the event stream returned by the chat completion (chatCompletion) API. When type=result and status=success, the historyId in the result field of the event is required. For details, see Session Completion.

Response parameters

The API returns an insightAbilities list, where each object represents an available analysis capability. You need to pay attention to the ability_code (capability code) and enable (whether available) fields.

Parameter

Type

Example value

Description

insightAbilities

list

For details, see the response example below

Each object in the insightAbilities list represents an available analytical capability. The ability_code (capability code) and enable (whether available) fields in each analytical capability indicate whether the corresponding analytical capability can be used for the current query result.

insightAbilities.ability_code

string

attribution

Unique code identifying the analytical capability, mainly including:

  • attribution: Attribution analysis
  • anomaly: Anomaly detection
  • interpret: Data interpretation

insightAbilities.enable

boolean

true

Indicates whether this capability is available in the context of the current data query result.

insightAbilities.cause

string

For details, see the return example below

If the corresponding analytical capability is not supported in the context of the current data query result, the cause field provides a description of the reason why it is not supported.

insightAbilities.ability_params

list

For details, see the return example below

Specific parameters for the corresponding analytical capability. The parameters included in each analytical capability differ and are similar to the operation in the interface.
For example, for the attribution analysis capability, the returned result includes attribution metrics, attribution dimensions, baseline date, and observation date, and also returns recommended values for the corresponding parameters for you. The result is similar to the operation in the interface.
For the parameters of different analytical capabilities, refer to the documentation for interface operations: Data interpretation, Anomaly detection, Attribution analysis.

Response example

The following is a response example showing multiple analysis capabilities and their statuses.

{
    "code": "llm/ok",
    "data": {
        "insightAbilities": [
            {
                "ability_code": "attribution",
                "ability_name": "归因",
                "enable": false,
                "cause": "没有时间字段",
                "ability_params": [
                    // ... Specific parameters omitted
                ]
            },
            {
                "ability_code": "anomaly",
                "ability_name": "异常检测",
                "enable": false,
                "cause": "没有时间字段",
                "ability_params": [
                    // ... Specific parameters omitted
                ]
            },
            {
                "ability_code": "interpret",
                "ability_name": "解读",
                "enable": true,
                "cause": "",
                "ability_params": [
                    // ... Specific parameters omitted
                ]
            }
        ]
    }
}
Last updated: 2026.06.02 14:53:15