Conversation
run_query 改为 generator,PER Loop 各阶段 yield 中间状态 (规划 → 检索 → 评估 → 生成),用户实时看到进度而非对着空白等整轮结束; on_submit 相应改为 yield from。实测 7 次流式更新,最终返回带引用答案。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
概述
把 Gradio chat 模式的
run_query改为 generator,PER Loop 各阶段实时yield进度到 UI,用户不再对着空白等整轮结束(一次问答通常 5-10s)。变更
run_query→ generator:立即回显用户消息 + assistant 占位,随后在规划 → 检索(每轮) → 评估(每轮) → 生成各阶段更新进度文字并 yieldon_submit→yield from run_query(...),Gradio 自动流式渲染验证
ruff check→ All checks passedpy_compile通过(
规划中 → 检索(1/2) → 评估(1/2) → 检索(2/2) → 评估(2/2) → 生成中 → 答案),最终返回
Google's advertising revenue in 2023 was $237,855 million [1]+ sources说明
本次为阶段性进度流(改善感知延迟,改动集中、低风险)。最终答案的 token 级打字机流式(需
gemini_client加chat_stream+ Synthesizer agentic loop 改造)作为可选后续,未包含在本 PR。🤖 Generated with Claude Code