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) 3.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.getPolishPrompt = void 0; const getPolishPrompt = language => `# Task\nYou are a visualization and data analysis expert, and you possess excellent language polishing skills. The user extracted some insights from a chart.Your task is to refine the structured insights extracted by users into highly readable text content for data consumers to review.\n\n# User Import\n\`\`\`typescript\n{\n insights: { // user's insights\n type: InsightType,\n content: string; // text template of insight\n variables: Record<string, {value: string, fieldName: string}>\n }[]\n}\n\`\`\`\n## InsightType\nInsightType is an enum that represents the type of insight.Specific details are as follows:\n\n- Outlier: Outlier Point in Chart\n- Turning Point: Turning point in the chart, where the data distribution changes.\n- Extreme Value: Extreme value in the chart, such as the maximum or minimum value.\n- Majority Value: A value with a large contribution in a group.\n- Abnormal Band: Only for time series data, indicating an overall anomaly in a specific time interval.\n- Overall Trend: Overall trend of the data.\n- Abnormal Trend: A particular series has an anomalous trend, differing from the overall trend.\n- Correlation: Correlation between two or more variables.\n- Volatility: A series in the chart has cyclical fluctuations.\n\n## Content of Insight\nContent is the current insight text template, which includes placeholders like '\\\${a}'. The specific interpretation of these placeholders is in the variables, for example, '\\\${a}' means 'a' is a placeholder, and its specific interpretation is in variables['a'].\n## Variables of Insight\nVariables contain the specific interpretation of the placeholders, where the key represents the specific placeholder.The specific interpretation is as follows:\n\`\`\`typescript\n{\n value: string; // the specific value of the placeholder\n fieldName: string; // the fieldName of the specific value; Fields are the mapped fields in the chart, such as the x-axis, y-axis, or color.\n}\n\`\`\`\n\n# Response and Requirments\nOutput the polished result for each insight text.\n1. Strictly define the type of return format, use JSON format to reply。\n2. The order of the polished results corresponds one-to-one with the input order.\n3. KEEP the placeholders UNCHANGED in the polished results.\n4. The final result must be answered in ${language}.\n\nThe return format is as follows:\n\`\`\`\n{results: string[]}\n\`\`\`\n# Example\n## Input\n\`\`\`\n{"insights":[{"type":"outlier","content":"\${a}在\${b}上有异常值,值为\${c}","variables":{"a":{"value":"西南","fieldName":"区域"},"b":{"field":"2024-07-07","fieldName":"日期"},"c":{"value":1000,"fieldName":"销售额"}}},{"type":"abnormal_band","content":"\${a}在\${b}-\${c}之间存在异常区间","variables":{"a":{"value":"西南","fieldName":"区域"},"b":{"field":"2024-07-07","fieldName":"日期"},"c":{"value":"2024-87-07","fieldName":"日期"}}}]}\n\`\`\`\n## Response\n\`\`\`\n{"results": ["\${a}地区的销售额在\${b}存在异常值,值为\${}。", "在\${b}至\${c}期间,\${a}地区的数据表现异常。"]}\n\`\`\``; exports.getPolishPrompt = getPolishPrompt; //# sourceMappingURL=prompt.js.map