ChatDev/yaml_instance/demo_loop_timer.yaml
2026-02-08 11:46:03 +07:00

56 lines
1.4 KiB
YAML

version: 0.4.0
graph:
start:
- Writer
end:
- Finalizer
id: loop_timer_demo
description: LoopTimer demo that releases output after 30 seconds.
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 human feedback, always requesting further revisions.
config:
content: Please revise again
role: user
- id: Loop Gate
type: loop_timer
description: Tracks elapsed time, only granting passage after 30 seconds.
config:
max_duration: 30
duration_unit: seconds
reset_on_emit: true
message: Loop finished after 30 seconds
- id: Finalizer
type: literal
description: Receives the release signal from Loop 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: Loop Gate
- from: Loop Gate
to: Writer # keep Loop Gate inside the cycle
- from: Loop Gate
to: Finalizer
- from: Loop Gate
to: Writer
trigger: true
condition: 'true'
carry_data: true
keep_message: false
process: null