feat: remove useless test code
This commit is contained in:
@@ -130,69 +130,4 @@ async function generateChart() {
|
||||
}
|
||||
}
|
||||
|
||||
async function test() {
|
||||
const inputData = {
|
||||
options: {
|
||||
url: "https://ark.cn-beijing.volces.com/api/v3/chat/completions",
|
||||
model: "ep-20250218181138-t86qb",
|
||||
headers: {
|
||||
"api-key": "5165caca-92dc-4c6b-936f-517a00d4aae3",
|
||||
Authorization: "Bearer 5165caca-92dc-4c6b-936f-517a00d4aae3",
|
||||
},
|
||||
},
|
||||
user_prompt: "帮我展示不同区域各商品销售额",
|
||||
fieldInfo: [
|
||||
{
|
||||
fieldName: "商品名称",
|
||||
type: "string",
|
||||
role: "dimension",
|
||||
domain: ["可乐", "雪碧", "芬达", "醒目"],
|
||||
},
|
||||
{
|
||||
fieldName: "region",
|
||||
type: "string",
|
||||
role: "dimension",
|
||||
domain: ["south", "east", "west", "north"],
|
||||
},
|
||||
{
|
||||
fieldName: "销售额",
|
||||
type: "int",
|
||||
role: "measure",
|
||||
domain: [28, 2350],
|
||||
},
|
||||
],
|
||||
dataset: [
|
||||
{ 商品名称: "可乐", region: "south", 销售额: 2350 },
|
||||
{ 商品名称: "可乐", region: "east", 销售额: 1027 },
|
||||
{ 商品名称: "可乐", region: "west", 销售额: 1027 },
|
||||
{ 商品名称: "可乐", region: "north", 销售额: 1027 },
|
||||
{ 商品名称: "雪碧", region: "south", 销售额: 215 },
|
||||
{ 商品名称: "雪碧", region: "east", 销售额: 654 },
|
||||
{ 商品名称: "雪碧", region: "west", 销售额: 159 },
|
||||
{ 商品名称: "雪碧", region: "north", 销售额: 28 },
|
||||
{ 商品名称: "芬达", region: "south", 销售额: 345 },
|
||||
{ 商品名称: "芬达", region: "east", 销售额: 654 },
|
||||
{ 商品名称: "芬达", region: "west", 销售额: 2100 },
|
||||
{ 商品名称: "芬达", region: "north", 销售额: 1679 },
|
||||
{ 商品名称: "醒目", region: "south", 销售额: 1476 },
|
||||
{ 商品名称: "醒目", region: "east", 销售额: 830 },
|
||||
{ 商品名称: "醒目", region: "west", 销售额: 532 },
|
||||
{ 商品名称: "醒目", region: "north", 销售额: 498 },
|
||||
],
|
||||
output_type: "html",
|
||||
};
|
||||
const vmind2 = new VMind(inputData.options);
|
||||
const res = await vmind2.generateChart(
|
||||
inputData.user_prompt,
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
inputData.fieldInfo as any,
|
||||
inputData.dataset,
|
||||
{
|
||||
enableDataQuery: false,
|
||||
theme: "light",
|
||||
}
|
||||
);
|
||||
console.log(res);
|
||||
}
|
||||
// test();
|
||||
generateChart();
|
||||
|
||||
Reference in New Issue
Block a user