chore: initial branch commit
This commit is contained in:
@@ -5,6 +5,7 @@ export type Plan = {
|
||||
}
|
||||
|
||||
export type PlanElement = Goal | Action
|
||||
export type PlanElementTypes = ActionTypes | "goal"
|
||||
|
||||
export type Goal = {
|
||||
id: string,
|
||||
@@ -20,7 +21,7 @@ export type SpeechAction = { id: string, text: string, type:"speech" }
|
||||
export type GestureAction = { id: string, gesture: string, isTag: boolean, type:"gesture" }
|
||||
export type LLMAction = { id: string, goal: string, type:"llm" }
|
||||
|
||||
export type ActionTypes = "speech" | "gesture" | "llm";
|
||||
export type ActionTypes = "speech" | "gesture" | "llm"
|
||||
|
||||
|
||||
// Extract the wanted information from a plan within the reducing of nodes
|
||||
@@ -75,7 +76,7 @@ function StepReduce(planElement: PlanElement) {
|
||||
export function DoesPlanIterate(plan?: Plan) : boolean {
|
||||
// TODO: should recursively check plans that have goals (and thus more plans) in them.
|
||||
if (!plan) return false
|
||||
return plan.steps.filter((step) => step.type == "llm").length > 0;
|
||||
return plan.steps.filter((step) => step.type == "llm").length > 0 || (plan.steps.filter((x) => x.type == "goal").map((x) => DoesPlanIterate(x.plan))).includes(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user