mirror of
https://github.com/OpenBMB/ChatDev.git
synced 2026-08-01 10:56:06 +00:00
fix: Correct loop structure in demo_loop_timer.yaml
Key fixes: - Add proper trigger edges: Critic -> Timer Gate with trigger=true - Add feedback loop: Timer Gate -> Writer with trigger=true - Remove incorrect Writer -> Critic -> Timer Gate -> Writer pattern - Follow ChatDev_v1 loop pattern: input -> gate (trigger) -> gate -> output (trigger) - Start both branches simultaneously in start nodes This ensures the timer gates are properly triggered and loops execute correctly.
This commit is contained in:
parent
f7ece916ce
commit
b56e89313e
@ -3,26 +3,20 @@ graph:
|
|||||||
description: |
|
description: |
|
||||||
Comprehensive LoopTimer demonstration with both standard and passthrough modes.
|
Comprehensive LoopTimer demonstration with both standard and passthrough modes.
|
||||||
|
|
||||||
STANDARD MODE BRANCH:
|
STANDARD MODE (left branch):
|
||||||
StandardWriter → StandardCritic → Standard Timer Gate (2 min) → StandardFinalizer
|
Writer loops with Critic through Standard Timer Gate for 2 minutes,
|
||||||
|
then releases to StandardFinalizer.
|
||||||
|
|
||||||
The Standard Timer Gate suppresses messages for 2 minutes, then emits a time limit
|
PASSTHROUGH MODE (right branch):
|
||||||
message to StandardFinalizer. The feedback loop (StandardCritic → StandardWriter)
|
Writer loops with Critic through Passthrough Timer Gate, messages pass through
|
||||||
continues running but outputs are blocked by the gate until time expires.
|
immediately to PassthroughFinalizer, timer emits at 2 minutes then transparent.
|
||||||
|
|
||||||
PASSTHROUGH MODE BRANCH:
|
|
||||||
PassthroughWriter → PassthroughCritic → Passthrough Timer Gate (2 min) → PassthroughFinalizer
|
|
||||||
|
|
||||||
The Passthrough Timer Gate allows messages through immediately, maintains a parallel
|
|
||||||
feedback loop (PassthroughCritic → PassthroughWriter), and after 2 minutes emits a
|
|
||||||
time limit message before becoming transparent.
|
|
||||||
log_level: INFO
|
log_level: INFO
|
||||||
is_majority_voting: false
|
is_majority_voting: false
|
||||||
nodes:
|
nodes:
|
||||||
# ===== STANDARD MODE BRANCH =====
|
# ===== STANDARD MODE BRANCH =====
|
||||||
- id: StandardWriter
|
- id: StandardWriter
|
||||||
type: literal
|
type: literal
|
||||||
description: Standard mode - outputs draft messages that get blocked by timer gate.
|
description: Standard mode - outputs draft messages.
|
||||||
config:
|
config:
|
||||||
content: "[STANDARD] Draft iteration from Writer"
|
content: "[STANDARD] Draft iteration from Writer"
|
||||||
role: assistant
|
role: assistant
|
||||||
@ -38,8 +32,7 @@ graph:
|
|||||||
type: loop_timer
|
type: loop_timer
|
||||||
description: |
|
description: |
|
||||||
Standard mode (passthrough=false) - Suppresses messages for 2 minutes.
|
Standard mode (passthrough=false) - Suppresses messages for 2 minutes.
|
||||||
After 2 minutes elapsed, emits time limit message and allows passage to StandardFinalizer.
|
After 2 minutes, emits message to StandardFinalizer.
|
||||||
Timer resets after emission (reset_on_emit=true).
|
|
||||||
config:
|
config:
|
||||||
max_duration: 2
|
max_duration: 2
|
||||||
duration_unit: minutes
|
duration_unit: minutes
|
||||||
@ -57,7 +50,7 @@ graph:
|
|||||||
# ===== PASSTHROUGH MODE BRANCH =====
|
# ===== PASSTHROUGH MODE BRANCH =====
|
||||||
- id: PassthroughWriter
|
- id: PassthroughWriter
|
||||||
type: literal
|
type: literal
|
||||||
description: Passthrough mode - outputs draft messages that pass through immediately.
|
description: Passthrough mode - outputs draft messages.
|
||||||
config:
|
config:
|
||||||
content: "[PASSTHROUGH] Draft iteration from Writer"
|
content: "[PASSTHROUGH] Draft iteration from Writer"
|
||||||
role: assistant
|
role: assistant
|
||||||
@ -73,8 +66,7 @@ graph:
|
|||||||
type: loop_timer
|
type: loop_timer
|
||||||
description: |
|
description: |
|
||||||
Passthrough mode (passthrough=true) - Allows messages through immediately.
|
Passthrough mode (passthrough=true) - Allows messages through immediately.
|
||||||
After 2 minutes elapsed, emits time limit message.
|
After 2 minutes, emits message then becomes transparent.
|
||||||
Then becomes transparent gate (no reset, continues passing through).
|
|
||||||
config:
|
config:
|
||||||
max_duration: 2
|
max_duration: 2
|
||||||
duration_unit: minutes
|
duration_unit: minutes
|
||||||
@ -84,54 +76,63 @@ graph:
|
|||||||
|
|
||||||
- id: PassthroughFinalizer
|
- id: PassthroughFinalizer
|
||||||
type: literal
|
type: literal
|
||||||
description: Passthrough mode - receives output immediately and continues receiving after timer.
|
description: Passthrough mode - receives outputs immediately and after timer.
|
||||||
config:
|
config:
|
||||||
content: "[PASSTHROUGH] Final summary released"
|
content: "[PASSTHROUGH] Final summary released"
|
||||||
role: assistant
|
role: assistant
|
||||||
|
|
||||||
edges:
|
edges:
|
||||||
# ===== STANDARD MODE EDGES =====
|
# ===== STANDARD MODE EDGES =====
|
||||||
# Main forward path
|
# Initial flow: Writer -> Critic -> Timer Gate
|
||||||
- from: StandardWriter
|
- from: StandardWriter
|
||||||
to: StandardCritic
|
to: StandardCritic
|
||||||
|
|
||||||
- from: StandardCritic
|
- from: StandardCritic
|
||||||
to: Standard Timer Gate
|
to: Standard Timer Gate
|
||||||
|
trigger: true
|
||||||
|
condition: 'true'
|
||||||
|
carry_data: false
|
||||||
|
keep_message: false
|
||||||
|
|
||||||
# Feedback loop (blocked until timer expires)
|
# Feedback loop: Timer Gate -> Writer (while time < 2 min)
|
||||||
- from: StandardCritic
|
- from: Standard Timer Gate
|
||||||
to: StandardWriter
|
to: StandardWriter
|
||||||
trigger: true
|
trigger: true
|
||||||
condition: 'true'
|
condition: 'true'
|
||||||
carry_data: true
|
carry_data: false
|
||||||
keep_message: false
|
keep_message: false
|
||||||
|
|
||||||
# Timer gate output (only after 2 minutes)
|
# Exit: Timer Gate -> Finalizer (when time >= 2 min)
|
||||||
- from: Standard Timer Gate
|
- from: Standard Timer Gate
|
||||||
to: StandardFinalizer
|
to: StandardFinalizer
|
||||||
|
|
||||||
# ===== PASSTHROUGH MODE EDGES =====
|
# ===== PASSTHROUGH MODE EDGES =====
|
||||||
# Main forward path
|
# Initial flow: Writer -> Critic -> Timer Gate
|
||||||
- from: PassthroughWriter
|
- from: PassthroughWriter
|
||||||
to: PassthroughCritic
|
to: PassthroughCritic
|
||||||
|
|
||||||
- from: PassthroughCritic
|
- from: PassthroughCritic
|
||||||
to: Passthrough Timer Gate
|
to: Passthrough Timer Gate
|
||||||
|
trigger: true
|
||||||
|
condition: 'true'
|
||||||
|
carry_data: false
|
||||||
|
keep_message: false
|
||||||
|
|
||||||
# Feedback loop (always active)
|
# Feedback loop: Timer Gate -> Writer (always active)
|
||||||
- from: PassthroughCritic
|
- from: Passthrough Timer Gate
|
||||||
to: PassthroughWriter
|
to: PassthroughWriter
|
||||||
trigger: true
|
trigger: true
|
||||||
condition: 'true'
|
condition: 'true'
|
||||||
carry_data: true
|
carry_data: false
|
||||||
keep_message: false
|
keep_message: false
|
||||||
|
|
||||||
# Timer gate output (immediate passthrough + timer message at 2 min)
|
# Passthrough: Timer Gate -> Finalizer (immediate + at 2 min)
|
||||||
- from: Passthrough Timer Gate
|
- from: Passthrough Timer Gate
|
||||||
to: PassthroughFinalizer
|
to: PassthroughFinalizer
|
||||||
|
|
||||||
start:
|
start:
|
||||||
- StandardWriter
|
- StandardWriter
|
||||||
|
- PassthroughWriter
|
||||||
end:
|
end:
|
||||||
- StandardFinalizer
|
- StandardFinalizer
|
||||||
- PassthroughFinalizer
|
- PassthroughFinalizer
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user