feat: make workflow messages resumable
This commit is contained in:
@@ -38,7 +38,6 @@ export function GenericNode({ id, type, data, selected }: NodeProps) {
|
||||
const entryModeLabel = {
|
||||
wait_user: "等待用户",
|
||||
generate: "立即回复",
|
||||
fixed_speech: "固定进入语",
|
||||
}[nodeData.entryMode ?? "wait_user"];
|
||||
const inheritsGlobal = nodeData.inheritGlobalConfig !== false;
|
||||
const meta = type === "agent"
|
||||
|
||||
@@ -69,7 +69,6 @@ function defaultNodeData(spec: RuntimeNodeSpec): WorkflowNodeData {
|
||||
contextPolicy: "inherit",
|
||||
inheritGlobalConfig: true,
|
||||
entryMode: "wait_user",
|
||||
entrySpeech: "",
|
||||
});
|
||||
} else if (spec.type === "action") {
|
||||
Object.assign(data, {
|
||||
|
||||
@@ -170,28 +170,13 @@ export function AgentNodePanel({
|
||||
options={[
|
||||
{ value: "wait_user", label: "等待用户说话(默认)" },
|
||||
{ value: "generate", label: "立即让 LLM 回复" },
|
||||
{ value: "fixed_speech", label: "播放固定进入语" },
|
||||
]}
|
||||
onChange={(value) => set("entryMode", value || "wait_user")}
|
||||
allowNone={false}
|
||||
/>
|
||||
{draft.entryMode === "fixed_speech" && (
|
||||
<label className="block">
|
||||
<div className="mb-1.5 text-sm font-medium text-foreground">
|
||||
固定进入语 <span className="text-destructive">*</span>
|
||||
</div>
|
||||
<Textarea
|
||||
rows={3}
|
||||
value={draft.entrySpeech ?? ""}
|
||||
onChange={(event) => set("entrySpeech", event.target.value)}
|
||||
placeholder="例如:您好,请告诉我需要处理的问题。"
|
||||
className="field-sizing-fixed min-h-24 resize-y border-hairline-strong bg-background text-sm text-foreground placeholder:text-muted-soft"
|
||||
/>
|
||||
<span className="mt-1.5 block text-xs text-muted-foreground">
|
||||
支持使用 {"{{variable}}"} 动态变量;只播放语音,不调用 LLM。
|
||||
</span>
|
||||
</label>
|
||||
)}
|
||||
<p className="text-xs leading-5 text-muted-foreground">
|
||||
固定播报、客户端弹窗和确认门禁请使用独立的 Message 节点。
|
||||
</p>
|
||||
</SectionCard>
|
||||
|
||||
{!inheritsGlobal && (
|
||||
|
||||
@@ -171,28 +171,13 @@ export function NodeSettingsPanel({
|
||||
options={[
|
||||
{ value: "wait_user", label: "等待用户说话(默认)" },
|
||||
{ value: "generate", label: "立即让 LLM 回复" },
|
||||
{ value: "fixed_speech", label: "播放固定进入语" },
|
||||
]}
|
||||
onChange={(value) => set("entryMode", value || "wait_user")}
|
||||
allowNone={false}
|
||||
/>
|
||||
{draft.entryMode === "fixed_speech" && (
|
||||
<div className="block">
|
||||
<div className="mb-2 text-sm font-medium text-foreground">
|
||||
固定进入语 <span className="text-destructive">*</span>
|
||||
</div>
|
||||
<Textarea
|
||||
rows={3}
|
||||
value={draft.entrySpeech ?? ""}
|
||||
onChange={(event) => set("entrySpeech", event.target.value)}
|
||||
placeholder="例如:您好,请告诉我需要处理的问题。"
|
||||
className="field-sizing-fixed min-h-24 resize-y border-hairline-strong bg-background text-foreground placeholder:text-muted-soft"
|
||||
/>
|
||||
<span className="mt-2 block text-xs text-muted-soft">
|
||||
支持使用 {"{{variable}}"} 动态变量;只播放语音,不调用 LLM。
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
<p className="text-xs leading-5 text-muted-soft">
|
||||
固定播报、客户端弹窗和确认门禁请使用独立的 Message 节点。
|
||||
</p>
|
||||
<div className="flex flex-col gap-2">
|
||||
<label className="text-sm font-medium text-foreground">可用工具</label>
|
||||
<ToolOptionPicker
|
||||
|
||||
@@ -15,7 +15,7 @@ export type WorkflowNodeType =
|
||||
| "end";
|
||||
export type ContextPolicy = "inherit" | "fresh";
|
||||
export type KnowledgeMode = "automatic" | "on_demand" | "disabled";
|
||||
export type AgentEntryMode = "wait_user" | "generate" | "fixed_speech";
|
||||
export type AgentEntryMode = "wait_user" | "generate";
|
||||
export type ActionResultAssignmentMode = "inherit" | "override" | "none";
|
||||
export type ActionUserInputPolicy = "queue" | "block";
|
||||
export type EdgeMode = "llm" | "expression" | "always";
|
||||
@@ -36,7 +36,6 @@ export type WorkflowNodeData = {
|
||||
contextPolicy?: ContextPolicy;
|
||||
inheritGlobalConfig?: boolean;
|
||||
entryMode?: AgentEntryMode;
|
||||
entrySpeech?: string;
|
||||
toolIds?: string[];
|
||||
knowledgeBaseId?: string;
|
||||
knowledgeMode?: KnowledgeMode;
|
||||
@@ -260,7 +259,6 @@ export function defaultGraph(): WorkflowGraph {
|
||||
contextPolicy: "inherit",
|
||||
inheritGlobalConfig: true,
|
||||
entryMode: "wait_user",
|
||||
entrySpeech: "",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user