From 8cc177041ac5716e48888a3c0a1d8ce38df690c1 Mon Sep 17 00:00:00 2001 From: Twirre Meulenbelt <43213592+TwirreM@users.noreply.github.com> Date: Tue, 16 Dec 2025 15:12:22 +0100 Subject: [PATCH] feat: add a second phase in test_program ref: N25B-376 --- .../agents/bdi/bdi_program_manager.py | 62 ++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/control_backend/agents/bdi/bdi_program_manager.py b/src/control_backend/agents/bdi/bdi_program_manager.py index 8f5bf03..2353fcb 100644 --- a/src/control_backend/agents/bdi/bdi_program_manager.py +++ b/src/control_backend/agents/bdi/bdi_program_manager.py @@ -97,7 +97,67 @@ test_program = Program( Goal(name="Tell a joke", plan=Plan(steps=[LLMAction(goal="Tell a joke.")])), ], id=1, - ) + ), + Phase( + id=2, + norms=[ + BasicNorm(norm="Use very gentle speech."), + ConditionalNorm( + condition=SemanticBelief( + description="We are talking to a child", name="talking to child" + ), + norm="Do not use cuss words", + ), + ], + triggers=[ + Trigger( + condition=InferredBelief( + left=KeywordBelief(keyword="help"), + right=SemanticBelief(description="User is stuck", name="stuck"), + operator=LogicalOperator.OR, + name="help_or_stuck", + ), + plan=Plan( + steps=[ + Goal( + name="Unblock user", + plan=Plan( + steps=[ + LLMAction( + goal="Provide a step-by-step path to " + "resolve the user's issue." + ) + ] + ), + ), + ] + ), + ), + ], + goals=[ + Goal( + name="Clarify intent", + plan=Plan( + steps=[ + LLMAction( + goal="Ask 1-2 targeted questions to clarify the " + "user's intent, then proceed." + ) + ] + ), + ), + Goal( + name="Provide solution", + plan=Plan( + steps=[LLMAction(goal="Deliver a solution to complete the user's goal.")] + ), + ), + Goal( + name="Summarize next steps", + plan=Plan(steps=[LLMAction(goal="Summarize what the user should do next.")]), + ), + ], + ), ] )