feat: separate prompt opening and entry behavior

This commit is contained in:
Xin Wang
2026-08-04 12:21:07 +08:00
parent 1af1cd7fed
commit 78bba090a2
8 changed files with 264 additions and 24 deletions
@@ -200,6 +200,7 @@ export function PromptEditor({
title: "重要提示",
message: "请确认已阅读以上信息。",
confirmLabel: "确认",
skipSpeechOnConfirm: true,
}
: null,
});
@@ -323,7 +324,7 @@ export function PromptEditor({
<div className="mt-4 space-y-3 border-t border-hairline pt-4">
<ToggleRow
title="开场确认弹窗"
description="与开场白同时显示,用户确认后即可开始对话,不等待播报完成。"
description="与开场白同时显示,用户确认后按下方策略进入对话。"
checked={Boolean(openingMessage)}
onChange={setOpeningMessage}
/>
@@ -367,12 +368,34 @@ export function PromptEditor({
className="border-hairline-strong bg-background"
/>
</label>
<ToggleRow
title="确认后跳过剩余开场白"
description="开启后立即停止尚未播完的开场白;关闭后等待播报完成再进入对话。"
checked={openingMessage.skipSpeechOnConfirm}
onChange={(skipSpeechOnConfirm) =>
updateOpeningMessage({ skipSpeechOnConfirm })
}
/>
<p className="text-xs leading-5 text-muted-foreground">
弹窗不可跳过;失败时将结束本次通话。这是平台内置开场阶段,
不会作为工具暴露给模型。
</p>
</div>
)}
<div className="border-t border-hairline pt-3">
<ToggleRow
title="进入后立即回复"
description="开启后由助手主动生成首句;关闭后等待用户下一轮输入。"
checked={form.startup.entryMode === "generate"}
onChange={(generate) =>
updateForm("startup", {
...form.startup,
entryMode: generate ? "generate" : "wait_user",
})
}
/>
</div>
</div>
)}
</SectionCard>
@@ -404,6 +427,7 @@ export function PromptEditor({
) {
updateForm("startup", {
executionMode: "sequential",
entryMode: "wait_user",
actions: [],
openingMessage: null,
});
@@ -179,6 +179,7 @@ function blankPromptForm(name: string): AssistantForm {
turnConfig: defaultTurnConfig(),
startup: {
executionMode: "sequential",
entryMode: "wait_user",
actions: [],
openingMessage: null,
},
@@ -472,6 +473,7 @@ export function AssistantPage(props: AssistantPageProps) {
turnConfig: normalizeTurnConfig(a.turnConfig),
startup: {
executionMode: "sequential",
entryMode: a.startup?.entryMode ?? "wait_user",
actions: a.startup?.actions ?? [],
openingMessage: a.startup?.openingMessage ?? null,
},
@@ -546,6 +548,7 @@ export function AssistantPage(props: AssistantPageProps) {
turnConfig: defaultTurnConfig(),
startup: {
executionMode: "sequential",
entryMode: "wait_user",
actions: [],
openingMessage: null,
},