Update cmbagent/hand_offs.py
Browse files- cmbagent/hand_offs.py +9 -9
cmbagent/hand_offs.py
CHANGED
|
@@ -98,16 +98,16 @@ def register_all_hand_offs(cmbagent_instance):
|
|
| 98 |
# plan_recorder: conditional routing based on feedback_left
|
| 99 |
# If feedback_left == 0, planning is complete -> go to terminator
|
| 100 |
# Otherwise, continue to plan_reviewer for feedback
|
| 101 |
-
agents['plan_recorder'].agent.handoffs.
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
|
|
|
|
|
|
| 105 |
),
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
condition=None, # Default fallback
|
| 109 |
-
),
|
| 110 |
-
])
|
| 111 |
|
| 112 |
# Response formatters that route differently based on mode
|
| 113 |
mode_dependent_formatters = ['camb_response_formatter']
|
|
|
|
| 98 |
# plan_recorder: conditional routing based on feedback_left
|
| 99 |
# If feedback_left == 0, planning is complete -> go to terminator
|
| 100 |
# Otherwise, continue to plan_reviewer for feedback
|
| 101 |
+
agents['plan_recorder'].agent.handoffs.set_after_work(
|
| 102 |
+
AgentTarget(agents['plan_reviewer'].agent)
|
| 103 |
+
).add_after_work(
|
| 104 |
+
OnContextCondition(
|
| 105 |
+
target=AgentTarget(agents['terminator'].agent),
|
| 106 |
+
condition=ExpressionContextCondition(
|
| 107 |
+
ContextExpression("${feedback_left} == 0")
|
| 108 |
),
|
| 109 |
+
)
|
| 110 |
+
)
|
|
|
|
|
|
|
|
|
|
| 111 |
|
| 112 |
# Response formatters that route differently based on mode
|
| 113 |
mode_dependent_formatters = ['camb_response_formatter']
|