Skip to content

Commit bda6f72

Browse files
authored
Merge pull request #49 from VisActor/fix-1.2.5-bugs
Fix 1.2.5 bugs
2 parents 81398df + f5e94c6 commit bda6f72

File tree

12 files changed

+193
-146
lines changed

12 files changed

+193
-146
lines changed

common/config/rush/pnpm-lock.yaml

+128-84
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vmind/__tests__/performance/performanceTest.ts

+23-32
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ import {
2222
mockUserInput12,
2323
mockUserInput13,
2424
mockUserInput14,
25-
mockUserInput16
25+
mockUserInput16,
26+
mockUserInput17
2627
} from '../browser/src/constants/mockData';
28+
29+
const TEST_GPT = false;
30+
const TEST_SKYLARK = true;
31+
2732
const demoDataList: { [key: string]: any } = {
2833
pie: mockUserInput2,
2934
'dynamic bar zh_cn': mockUserInput6,
@@ -44,7 +49,8 @@ const demoDataList: { [key: string]: any } = {
4449
'College entrance examination': acceptRatioData,
4550
'Shopping Mall Sales Performance': mallSalesData,
4651
'Global GDP': mockUserInput6Eng,
47-
'Sales of different drinkings': mockUserInput3Eng
52+
'Sales of different drinkings': mockUserInput3Eng,
53+
'Multi measure': mockUserInput17
4854
};
4955
const CHART_GENERATION_AVERAGE_TIME = 10000;
5056
const QPM_LIMIT = 10; //qpm limit of your llm service
@@ -53,7 +59,6 @@ const START_INDEX = 0;
5359

5460
const modelResultMap = {
5561
[Model.GPT3_5]: { totalCount: 0, successCount: 0, totalTime: 0 },
56-
[Model.SKYLARK]: { totalCount: 0, successCount: 0, totalTime: 0 },
5762
[Model.SKYLARK2]: { totalCount: 0, successCount: 0, totalTime: 0 }
5863
};
5964

@@ -88,48 +93,34 @@ const dataList = Object.keys(demoDataList);
8893

8994
const gptKey = process.env.VITE_GPT_KEY;
9095
const gptURL = process.env.VITE_GPT_JEST_URL;
91-
if (gptKey && gptURL) {
96+
if (gptKey && gptURL && TEST_GPT) {
9297
const vmind = new VMind({
9398
url: gptURL,
9499
model: Model.GPT3_5,
95-
cache: false,
100+
cache: true,
101+
showThoughts: false,
96102
headers: {
97103
'api-key': gptKey
98104
}
99105
});
100106
testPerformance(Model.GPT3_5, vmind);
101107
}
102108

103-
//const skylarkKey = process.env.VITE_SKYLARK_KEY;
104-
//const skylarkURL = process.env.VITE_SKYLARK_JEST_URL;
105-
106-
//if (skylarkKey && skylarkURL) {
107-
// const vmind = new VMind({
108-
// url: skylarkURL,
109-
// model: Model.SKYLARK,
110-
// cache: false,
111-
// headers: {
112-
// 'api-key': skylarkKey
113-
// }
114-
// });
115-
// testPerformance(Model.SKYLARK, vmind);
116-
//}
117-
118109
const skylark2Key = process.env.VITE_SKYLARK_KEY;
119110
const skylark2URL = process.env.VITE_SKYLARK_JEST_URL;
120111

121-
//if (skylark2Key && skylark2URL) {
122-
// const vmind = new VMind({
123-
// url: skylark2URL,
124-
// model: Model.SKYLARK2,
125-
// cache: false,
126-
// showThoughts: false,
127-
// headers: {
128-
// 'api-key': skylark2Key
129-
// }
130-
// });
131-
// testPerformance(Model.SKYLARK2, vmind);
132-
//}
112+
if (skylark2Key && skylark2URL && TEST_SKYLARK) {
113+
const vmind = new VMind({
114+
url: skylark2URL,
115+
model: Model.SKYLARK2,
116+
cache: true,
117+
showThoughts: false,
118+
headers: {
119+
'api-key': skylark2Key
120+
}
121+
});
122+
testPerformance(Model.SKYLARK2, vmind);
123+
}
133124

134125
afterAll(() => {
135126
log('---------------VMind performance test---------------');

packages/vmind/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"react": "^18.0.0",
7878
"react-dom": "^18.0.0",
7979
"react-router-dom": "6.9.0",
80-
"@visactor/vchart": "^1.9.0",
80+
"@visactor/vchart": "^1.10.2",
8181
"@rollup/plugin-dynamic-import-vars": "~2.1.0",
8282
"@types/lodash": "4.14.182",
8383
"@types/node": "*",

0 commit comments

Comments
 (0)