feat(asset-ai): generate contextual presentations and drilldown plans
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -74,6 +74,8 @@ export async function execute(
|
||||
}
|
||||
|
||||
if (plan.kind === "flow") {
|
||||
result.outcome = result.rows.length ? "complete" : "empty";
|
||||
result.summary = `${plan.start} 至 ${plan.end},交车 ${result.metrics[0].value} 车次(含替换交车 ${result.metrics[2].value} 车次),还车 ${result.metrics[1].value} 车次。${result.rows.length ? "" : "该范围暂无交退换业务记录。"}替换交车已计入交车,不能重复相加。`;
|
||||
result.insights = [
|
||||
"交车包含替换交车,不能将二者相加。流转范围按当前账号可见车辆筛选。",
|
||||
];
|
||||
@@ -107,6 +109,8 @@ export async function execute(
|
||||
) / 10
|
||||
: null,
|
||||
}));
|
||||
result.summary += ` 对比 ${start} 至 ${end}:${result.comparison.map(m => `${m.label}${m.delta === 0 ? "持平" : `${m.delta > 0 ? "增加" : "减少"} ${Math.abs(m.delta)} 车次`}`).join(",")}。`;
|
||||
result.insights!.push("上述变化是业务车次对比;缺少经营目标、收入和成本依据,不能仅凭车次判断经营改善或变差,也不能据此推断车辆净增长。");
|
||||
result.insights!.push(
|
||||
`对比上一等长周期 ${start} 至 ${end};基期为0时不计算增长率。`,
|
||||
);
|
||||
@@ -119,6 +123,7 @@ export function applyAction(
|
||||
result: AssistantResult,
|
||||
): QueryPlan {
|
||||
const next = structuredClone(plan);
|
||||
if (next.analysis === "briefing" && ["category", "group", "drill", "exception"].includes(action.type)) next.analysis = "distribution";
|
||||
switch (action.type) {
|
||||
case "clear-filter":
|
||||
if (!DIMENSIONS.includes(action.dimension))
|
||||
|
||||
Reference in New Issue
Block a user