fix(go-models): increase JieKouAI SSE scanner buffer (#15737)

## Summary
- Raise the JieKouAI streaming SSE scanner buffer to handle larger data
chunks without truncation.
This commit is contained in:
oktofeesh
2026-06-07 22:10:10 -07:00
committed by GitHub
parent 5e25e2600b
commit b1a2210d06
2 changed files with 2 additions and 0 deletions

View File

@@ -292,6 +292,7 @@ func (j *JieKouAIModel) ChatStreamlyWithSender(modelName string, messages []Mess
// SSE parsing: read line by line
scanner := bufio.NewScanner(resp.Body)
scanner.Buffer(make([]byte, 64*1024), 1024*1024)
for scanner.Scan() {
line := scanner.Text()

View File

@@ -59,6 +59,7 @@ func TestChatStreamLargeChunkNotTruncated(t *testing.T) {
{"lmstudio", build(func(b map[string]string, s URLSuffix) chatStreamer { return NewLmStudioModel(b, s) })},
{"gitee", build(func(b map[string]string, s URLSuffix) chatStreamer { return NewGiteeModel(b, s) })},
{"tokenhub", build(func(b map[string]string, s URLSuffix) chatStreamer { return NewTokenHubModel(b, s) })},
{"jiekouai", build(func(b map[string]string, s URLSuffix) chatStreamer { return NewJieKouAIModel(b, s) })},
}
for _, tc := range cases {