Skip to content

fix: resolve "bufio.Scanner: token too long" error by increasing buff…#2128

Open
qistchan wants to merge 1 commit intosongquanpeng:mainfrom
qistchan:fix-#1982
Open

fix: resolve "bufio.Scanner: token too long" error by increasing buff…#2128
qistchan wants to merge 1 commit intosongquanpeng:mainfrom
qistchan:fix-#1982

Conversation

@qistchan
Copy link

close #1982


在请求包含了如联网搜索、知识库查询等接口时,在流式接口的第一行往往会带上大量的references内容。

如请求火山引擎进行天气查询时,首行返回的文本 ~75kb
image
超过缓冲区大小
image

默认bufio.Scanner的缓冲区只有64kb,适当调整至256kb,兼容该场景。


我已确认该 PR 已自测通过,相关截图如下:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

error reading stream: bufio.Scanner: token too long

1 participant