Text2InsightQuery - Submit a Data Analysis Request
Submit a natural language question to Analytics Agent to initiate a data analysis task.
Interface Description
This interface is asynchronous. Upon a successful call, it returns a questionId and an initial status of running, indicating that the analysis task has started. The client must poll for analysis results via the SafeQuestionPoll interface.
Usage Notes
- Questions are described in natural language; the Agent will automatically understand and perform the analysis.
- Supports specifying the model to use via
modelSettings. - Multiple questions can be submitted consecutively within the same Session, and the Agent retains conversational context.
Usage Recommendations
- Make question descriptions as clear and specific as possible, including key information such as time ranges and dimensions.
- If you need the knowledge base to assist with the analysis, you can prompt the Agent in the question to consult the knowledge base.
Request Method
Request Parameters
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
| tenantId | Query + Body | Integer | Yes | Tenant ID |
| userId | Query + Body | Integer | Yes | User ID |
| domainId | Body | Integer | Yes | Data domain ID |
| sessionId | Body | Integer | Yes | Conversation session ID, obtained via CreateSession or reusing an existing value |
| msg | Body | String | Yes | Question content, an analysis request described in natural language |
| loginToken | Query + Body | String | Yes | Authentication Token |
| modelSettings | Body | Object | No | Model configuration |
| modelSettings.model_name | Body | String | No | Specify the model name to use |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| success | Boolean | Whether the request was successful |
| data.questionId | Integer | Question ID, used for subsequent polling and stop operations |
| data.sessionId | Integer | Session ID |
| data.status | String | Current status; initial value is running |
Request Example
Response Example
Successful response:
Next Steps
After a successful request, use the returned questionId to call SafeQuestionPoll and poll until the analysis is complete.
Error Codes
| Error Code | Description |
|---|---|
| success=false | Token is invalid, Session does not exist, parameters are missing, or model is unavailable |
Related Documentation
- CreateSession — Previous step: create a conversation session
- SafeQuestionPoll — Next step: poll for analysis results
- Understanding Response Results — Message type descriptions and display recommendations
- Quick Start — Complete end-to-end example
