docs: add description to condition definitions

This commit is contained in:
2026-05-18 08:41:29 +00:00
parent 13d932f69c
commit c91a3d1ec6
+12 -3
View File
@@ -164,8 +164,12 @@ payload:
systemPrompt: "You are a code reviewer..." systemPrompt: "You are a code reviewer..."
outputSchema: "1VPBG9SM5E7WK" # cas_ref → JSON Schema 节点 outputSchema: "1VPBG9SM5E7WK" # cas_ref → JSON Schema 节点
conditions: conditions:
needsClarification: "$exists(steps[-1].output.needsClarification)" needsClarification:
notApproved: "steps[-1].output.approved = false" description: "Planner requests clarification from user"
expression: "$exists(steps[-1].output.needsClarification)"
notApproved:
description: "Reviewer rejected the implementation"
expression: "steps[-1].output.approved = false"
graph: graph:
$START: $START:
- role: "planner" - role: "planner"
@@ -398,11 +402,16 @@ type Transition = {
condition: string | null; // 引用 conditions 中的 key,null = fallback condition: string | null; // 引用 conditions 中的 key,null = fallback
}; };
type ConditionDefinition = {
description: string;
expression: string; // JSONata expression
};
type WorkflowPayload = { type WorkflowPayload = {
name: string; name: string;
description: string; description: string;
roles: Record<string, RoleDefinition>; roles: Record<string, RoleDefinition>;
conditions: Record<string, string>; // Record<Name, JSONata expression> conditions: Record<string, ConditionDefinition>;
graph: Record<string, Transition[]>; // Record<Role | "$START", Transition[]> graph: Record<string, Transition[]>; // Record<Role | "$START", Transition[]>
}; };
``` ```