You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Used to extract data, recommend charts, and render charts. All functionalities are AI-driven.
18
20
*/
19
21
exportclassAdvisor{
20
-
21
22
/**
22
23
* Configuration for the advisor. Includes LLM settings, chart inclusion/exclusion lists.
23
24
*/
@@ -36,13 +37,13 @@ export class Advisor {
36
37
37
38
/**
38
39
* Extract data shards from raw data or user query.
39
-
*
40
+
*
40
41
* Case 1 - User provides a text query, extract relevant data shards:
41
-
*
42
+
*
42
43
advisor.extract('What is the average age of people who work as engineers?');
43
-
*
44
+
*
44
45
* Case 2 - User provides a query with raw data:
45
-
*
46
+
*
46
47
advisor.extract(`帮我可视化以下数据:
47
48
城市 类别 渠道 销售额 价格
48
49
杭州 体育 A 100 80
@@ -51,9 +52,9 @@ export class Advisor {
51
52
广州 体育 B 120 70
52
53
深圳 体育 C 180 95
53
54
`);
54
-
*
55
+
*
55
56
* Case 3 - User provides raw data, extract data shards directly:
56
-
*
57
+
*
57
58
advisor.extract({ type: 'A', value: 2 });
58
59
*/
59
60
asyncextract(params: AdviseChartParams){
@@ -66,40 +67,41 @@ export class Advisor {
66
67
/**
67
68
* Advise charts based on the data shards, which are extracted from the `advisor.extract` API.
68
69
* This is the core function of the Advisor class, which leverages LLMs to recommend suitable chart types and encodings based on the provided data and user purpose.
0 commit comments