UNPKG

@visactor/vmind

Version:

<div align="center"> <a href="https://github.com/VisActor#gh-light-mode-only" target="_blank"> <img alt="VisActor Logo" width="200" src="https://github.com/VisActor/.github/blob/main/profile/logo_500_200_light.svg"/> </a> <a href="https://githu

10 lines (7 loc) 2.84 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.getChartCommandPrompt = void 0; const getChartCommandPrompt = language => `As an expert in data visualization and analysis, your task is to generate a visual description based on the requirements.\n# User Input\n1. The data table and field information are extracted from the existing text.\n2. The data in the data table comes from the text, so some fields may be incomplete.\n3. The text may be empty.\nUser Input is Bellow:\n\`\`\`typescript\n{\nuserInput: {\nfieldInfo: {\nfieldName: string; // name of this field,\ntype?: 'measure' | 'dimension',\ndataLength?: number, // The number of valid data contained in the current field.\n}[],\ntext?: string;\nsummary?: string; // summary of text and data table\ndataTable?: Record<string, string | number>[]; // Specific data\n}\n}[]\n\`\`\`\n# Response\n\`\`\`\n {\n commands: (string | false)[]; // visual description or false\n }\n\`\`\`\n# Requirments\n1. For each element in the user input array, generate a visual description.\n2. Visual descriptions need to correspond one-to-one with user inputs.\n3. The visual description information needs to be concise and clear.\n# Steps\nYou should carefully think and execute the following steps:\n1. Traverse user's input, executing steps 2 to 8 for each element.\n2. Find the MOST IMPORTANT measure field based on the user's input.\n3. Ignore those fields where data is clearly missing or insufficient.\n4. Try to use the fewest fields to display the most important information.\n5. Generate a precise and concise visual description based on your rich experience.\n6. The description needs to include the field name.\n7. The final description does not need to use all fields, as some fields may be incomplete or unimportant.\n8. If unable to generate, return command is false.\n9. MUST return in JSON mode with ${language} language.\n# Examples1\n## User Input:\n\`\`\`\n{"userInput":[{"fieldInfo":[{"fieldName":"公司","type":"dimension","dataLength":2},{"fieldName":"调整前利润额","type":"measure","dataLength":2},{"fieldName":"调整后利润额","type":"measure","dataLength":2}],"summary":"各大厂商的财报数据","dataTable":[{"公司":"阿里","调整前利润额":1000,"调整后利润额":100},{"公司":"字节跳动","调整前利润额":800,"调整后利润额":120}]},{"summary":"入睡困难分布","fieldInfo":[{"fieldName":"性别","type":"dimension","dataLength":2},{"fieldName":"占比","type":"measure","dataLength":2}],"dataTable":[{"性别":"男","占比":60},{"性别":"女","占比":40}]}]}\n\`\`\`\n## Response\n\`\`\`\n{"commands": ["对比查看不同公司利润表现", "查看入睡困难的性别分布"]}\n\`\`\``; exports.getChartCommandPrompt = getChartCommandPrompt; //# sourceMappingURL=prompt.js.map