From 9c3df14fa75a097f20b70d54e805ef40f96ba0c8 Mon Sep 17 00:00:00 2001 From: laansdole Date: Sun, 8 Feb 2026 17:15:13 +0700 Subject: [PATCH] feat: finalize demo loop timer --- yaml_instance/demo_loop_timer.yaml | 69 +++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 21 deletions(-) diff --git a/yaml_instance/demo_loop_timer.yaml b/yaml_instance/demo_loop_timer.yaml index 0cbd5bf4..9d466759 100644 --- a/yaml_instance/demo_loop_timer.yaml +++ b/yaml_instance/demo_loop_timer.yaml @@ -1,40 +1,65 @@ -version: 0.4.0 +version: 0.0.0 graph: start: - Writer end: - Finalizer id: loop_timer_demo - description: LoopTimer demo that releases output after 30 seconds. + description: LoopTimer demo that releases output after 10 seconds of agent iterations. 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. + type: agent config: - content: Please revise again - role: user - - id: Loop Gate - type: loop_timer - description: Tracks elapsed time, only granting passage after 30 seconds. + name: ${MODEL_NAME} + provider: openai + role: You are a critic. Provide brief feedback (1 sentence) to improve the draft. + base_url: ${BASE_URL} + api_key: ${API_KEY} + params: {} + tooling: [] + thinking: null + memories: [] + retry: null + description: Reviews the draft and provides feedback for improvement. + context_window: 0 + log_output: true + - id: Writer + type: agent config: - max_duration: 30 - duration_unit: seconds - reset_on_emit: true - message: Loop finished after 30 seconds + name: ${MODEL_NAME} + provider: openai + role: You are a technical writer. Generate a brief draft (1 sentence). + base_url: ${BASE_URL} + api_key: ${API_KEY} + params: {} + tooling: [] + thinking: null + memories: [] + retry: null + description: Drafts content based on feedback. + context_window: 0 + log_output: true - id: Finalizer type: literal - description: Receives the release signal from Loop Gate and outputs the final statement. config: content: Final summary released role: assistant + description: Receives the release signal from Loop Gate and outputs the final statement. + context_window: 0 + log_output: true + - id: Loop Gate + type: loop_timer + config: + max_duration: 20 + duration_unit: seconds + reset_on_emit: true + message: Time limit reached - loop automatically terminated + passthrough: false + description: Tracks elapsed time, only granting passage after 10 seconds. + context_window: 0 + log_output: true edges: - from: Writer to: Critic @@ -43,7 +68,7 @@ graph: - from: Critic to: Loop Gate - from: Loop Gate - to: Writer # keep Loop Gate inside the cycle + to: Writer - from: Loop Gate to: Finalizer - from: Loop Gate @@ -53,3 +78,5 @@ graph: carry_data: true keep_message: false process: null +vars: + MODEL_NAME: qwen/qwen3-8b