Understanding Response Results
Overall Structure
The responses returned from polling is a message array that records, in chronological order, all output produced during the Agent's analysis. It is a mixed list of incremental process messages and final results.
A typical analysis produces the following message sequence:
Not all types appear every time; this depends on the complexity of the question and the analysis path chosen by the Agent.
Message Type Quick Reference
| Type | Should You Pay Attention | Description |
|---|---|---|
| summary | Yes (required) | Final analysis summary, containing data interpretation and business insights |
| metric | Yes (recommended) | Metric calculation results, including DSL definitions |
| echarts_plus | Yes (recommended) | Chart data, can be used directly for rendering |
| code | Yes (recommended) | Generated code (usually SQL) |
| message | Depends | May contain knowledge details or execution logs |
| notify | Usually ignore | Progress hints, e.g., "Thinking" |
| finish | Status only | Marks the end of analysis |
| finish_stop | Status only | Marks user-initiated stop |
| error | Handle it | Execution error |
Field Reading Rules
Business fields in each message may appear at different levels. Read in the following priority:
It is recommended to implement a unified function:
Detailed Description and Display Recommendations by Type
summary — Analysis Summary
This is the most important message, containing the final data insights and conclusions.
Key fields:
summaryData— Summary text (Markdown format)- If
summaryDatais empty, fall back tomessage
Display recommendation: Render directly as Markdown, supporting tables, bold, and other formatting.
Actual output example:
metric — Metric Calculation Result
Generated when the Agent performs calculations through the metric engine.
Key fields:
message— Metric name descriptionmetricDsl— Semantic layer DSL (JSON)physicalMetricDsl— Physical layer DSL (JSON)
Display recommendation: Show the metric name. For developer-facing views, DSL details can be collapsed.
Actual output example:
echarts_plus — Chart Data
Visualization chart configuration generated by the Agent.
Key fields:
message— Chart titlechartType— Chart type (e.g., ECHARTS)columns— Column definitionscalculateSql— SQL used to retrieve chart data
Display recommendation: Use the calculateSql query results with chartType for frontend rendering.
Actual output example:
code — Code Block
Code generated by the Agent, usually SQL.
Key fields:
codeType— Code language (e.g.,sql)code— Code content
Actual output example:
message — General Message
This is a "catch-all" type that may contain various content. The content should be further evaluated based on its context.
Contains Knowledge Details
When the message contains knowledgeData.detailItems, or the text includes Knowledge details: or Viewed knowledge details:, it represents knowledge retrieval results.
Display recommendation: Extract and display the knowledge entries to help users understand which business rules the Agent referenced.
Actual output example:
Contains Execution Process
When the text contains Executing metric calculation: or similar text, it represents metric execution logs.
Display recommendation: Show in developer-facing debugging interfaces; hide from business users.
notify — Progress Notification
Messages such as "Thinking next step" or "Searching knowledge base".
Display recommendation: Can be used to show status text in a loading animation, or ignored entirely.
error — Error
An exception occurred during analysis.
Display recommendation: Show the error message to the user and suggest retrying or rephrasing the question.
Recommended Display Priority
If you only need to show core results to end users, filter and display in the following order:
- summary — Primary display content
- echarts_plus — Paired with chart rendering
- code — SQL view (collapsible)
- metric — Metric details (collapsible)
- message (knowledge type) — Referenced knowledge (collapsible)
Other types need not be shown to end users.
Real Complete Output Example
The following is the key returned messages from a real Q&A session ("Beijing second-hand housing sales over the past 6 years, by district"):
Next Steps
- Return to API Overview to view the interface list
- View the complete parameter definitions for SafeQuestionPoll
