Repository navigation
Conversation
- 在非流式响应中合并相邻的文本片段与思考片段,避免响应被切碎 - 将 thoughtSignature 直接附着到对应 Part,消除多余的独立空签名 Part - 补充 geminiOutputParts 单元测试覆盖合并、思考签名附着及回退场景
Author
|
使用 gemini3.8f |
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.
Fixes #38
改动说明
internal/api/gemini.go的geminiOutputParts中,连续的EventText合并为单个完整文本 Part,连续的EventReasoning合并为单个完整思考 Part,避免非流式响应被按流式 chunk 切碎。thoughtSignature作为属性直接附着在对应的思考 Part 或工具调用 Part 上,消除多余且无文本的独立签名 Part。若遇到无后续 Part 的边缘情况,保留兜底。internal/api/gemini_output_test.go中补充 5 组针对合并、签名附着及 fallback 的测试用例,所有测试均通过。本地实测问题得到缓解