ChatDev/yaml_instance/demo_loop_timer_passthrough.yaml
laansdole 42cd389d59 feat: Add loop_timer node for time-based loop control
- Add LoopTimerConfig with duration units support (seconds/minutes/hours)
- Implement LoopTimerNodeExecutor with standard and passthrough modes
- Register loop_timer node type in builtin_nodes.py
- Update documentation (execution_logic.md, YAML_FORMAT_QUICK_GUIDE.md)
- Add demo workflows for both modes

Closes: add-loop-timer change proposal
2026-02-07 12:27:29 +07:00

52 lines
1.3 KiB
YAML

version: 0.4.0
graph:
start:
- Writer
end:
- Finalizer
id: loop_timer_passthrough_demo
description: LoopTimer passthrough mode demo - passes through messages before the limit, emits at the limit, then becomes transparent.
is_majority_voting: false
log_level: INFO
nodes:
- id: Writer
type: literal
description: Outputs a draft message.
config:
content: Draft iteration from Writer
role: assistant
- id: Critic
type: literal
description: Provides feedback.
config:
content: Please revise again
role: user
- id: Timer Gate
type: loop_timer
description: Passthrough mode - passes messages through before 5 seconds, emits limit message at 5 seconds, then transparent.
config:
max_duration: 5
duration_unit: seconds
reset_on_emit: false
message: Time limit reached - switching to passthrough
passthrough: true
- id: Finalizer
type: literal
description: Receives messages.
config:
content: Final summary released
role: assistant
edges:
- from: Writer
to: Critic
- from: Critic
to: Timer Gate
- from: Timer Gate
to: Writer
trigger: true
condition: 'true'
carry_data: true
keep_message: false
- from: Timer Gate
to: Finalizer