Repository navigation
Conversation
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.
变更
Refs #243(自动语言检测部分)。System 2 使用整批文本的中文字符占比 70% 阈值,导致
用户使用 Python 开发,运行 pytest tests/test_search_client.py --maxfail=1被判为英文。复用 SDK 已有的语言检测器,逐条检测非空 fact,再按事实条数多数投票。clustered / unprocessed facts 均参与;平票和空输入选英文。显式 language/config 优先级保持原有行为。新增回归测试,并验证实际 System 2 提示词选择和显式覆盖。
用户影响
技术型中文事实不再因长命令或路径稀释中文占比而选择英文提示词。混合材料按事实多数决定语言;启发式仍可能误判,模糊场景可显式设置语言。不涉及 issue 中另提的图库异常处理。
验证
uv run --no-sync ruff check tests/test_system2_language_detection.py、git diff --check通过测试命令:
隐私与安全
回滚
撤销本次提交即可,无数据迁移。
AI 辅助:Codex 参与排查、实现、测试与代码审查。未声明人工审核或完整 CI 已通过。