feat(loop): sequential chain builder - #219
Open
raymondginger2018-sudo wants to merge 1 commit into
Open
Conversation
Contributor
Author
设计说明问题:多步骤任务常常是"前一步的输出是后一步的输入"(如:搜索 → 下载 → 解压 → 读取),现有 loop 结构没有显式表达这种链式依赖,每次都要手工拼 prompt。 解法: 关键设计决策:
测试建议:验证 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an explicit sequential orchestration abstraction: define stages, each stage's task may reference the previous stage's result, and the chain is executed in order with results flowing forward.
Components
ChainStage— one step in a chain (name, task, optional persona/tools/output_schema/isolate flag)render_task(previous_result)— substitutes{previous_result}tokenSequentialBuilder— validates the chain (at least one stage, no conflicting aliases) and renders each stage's task with the previous resultDesign
File
core/loop/sequential_builder.py(new, 121 lines)Part of GenAI lesson 17 orchestration family.