mirror of
https://github.com/CJackHwang/ds2api.git
synced 2026-05-22 17:07:46 +08:00
修复接续流的增量bug
This commit is contained in:
@@ -54,9 +54,11 @@ func CollectStream(resp *http.Response, thinkingEnabled bool, closeBody bool) Co
|
||||
}
|
||||
for _, p := range result.Parts {
|
||||
if p.Type == "thinking" {
|
||||
thinking.WriteString(p.Text)
|
||||
trimmed := TrimContinuationOverlap(thinking.String(), p.Text)
|
||||
thinking.WriteString(trimmed)
|
||||
} else {
|
||||
text.WriteString(p.Text)
|
||||
trimmed := TrimContinuationOverlap(text.String(), p.Text)
|
||||
text.WriteString(trimmed)
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user