ChatDev/yaml_instance/demo_loop_timer.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

53 lines
1.3 KiB
YAML

version: 0.4.0
graph:
start:
- Writer
end:
- Finalizer
id: loop_timer_demo
description: LoopTimer demo that releases output after 5 seconds of elapsed time.
is_majority_voting: false
log_level: INFO
nodes:
- id: Writer
type: literal
description: Responsible for outputting a fixed draft.
config:
content: Draft iteration from Writer
role: assistant
- id: Critic
type: literal
description: Simulates feedback, always requesting further revisions.
config:
content: Please revise again
role: user
- id: Timer Gate
type: loop_timer
description: Counts elapsed time, only granting passage after 5 seconds.
config:
max_duration: 5
duration_unit: seconds
reset_on_emit: true
message: Loop finished after 5 seconds
- id: Finalizer
type: literal
description: Receives the release signal from Timer Gate and outputs the final statement.
config:
content: Final summary released
role: assistant
edges:
- from: Writer
to: Critic
- from: Critic
to: Writer
- 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