Skip to content

Commit 02dd839

Browse files
committed
fix: prompt optimization
1 parent f1c29c8 commit 02dd839

File tree

8 files changed

+173
-140
lines changed

8 files changed

+173
-140
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

+18-29
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ import {
2525
mockUserInput16,
2626
mockUserInput17
2727
} from '../browser/src/constants/mockData';
28+
29+
const TEST_GPT = false;
30+
const TEST_SKYLARK = true;
31+
2832
const demoDataList: { [key: string]: any } = {
2933
pie: mockUserInput2,
3034
'dynamic bar zh_cn': mockUserInput6,
@@ -55,7 +59,6 @@ const START_INDEX = 0;
5559

5660
const modelResultMap = {
5761
[Model.GPT3_5]: { totalCount: 0, successCount: 0, totalTime: 0 },
58-
[Model.SKYLARK]: { totalCount: 0, successCount: 0, totalTime: 0 },
5962
[Model.SKYLARK2]: { totalCount: 0, successCount: 0, totalTime: 0 }
6063
};
6164

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

9194
const gptKey = process.env.VITE_GPT_KEY;
9295
const gptURL = process.env.VITE_GPT_JEST_URL;
93-
if (gptKey && gptURL) {
96+
if (gptKey && gptURL && TEST_GPT) {
9497
const vmind = new VMind({
9598
url: gptURL,
9699
model: Model.GPT3_5,
97100
cache: true,
101+
showThoughts: false,
98102
headers: {
99103
'api-key': gptKey
100104
}
101105
});
102106
testPerformance(Model.GPT3_5, vmind);
103107
}
104108

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

123-
//if (skylark2Key && skylark2URL) {
124-
// const vmind = new VMind({
125-
// url: skylark2URL,
126-
// model: Model.SKYLARK2,
127-
// cache: false,
128-
// showThoughts: false,
129-
// headers: {
130-
// 'api-key': skylark2Key
131-
// }
132-
// });
133-
// testPerformance(Model.SKYLARK2, vmind);
134-
//}
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+
}
135124

136125
afterAll(() => {
137126
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)