mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-13 22:56:28 +00:00
fix: 修复最后一个流为[xxxx]格式时会重复输出1次 (#5673)
* fix: 修复最后一个流为[xxxx]格式时会重复输出1次 issue #5292 当最后一个流中包含[xxxx]格式时,会输出2次。第一次在parseCite方法中if (isStreamEnd) {分支内输出,第二次在调用getResponseData时会输出buffer中的内容,导致重复。 * add test case --------- Co-authored-by: archer <545436317@qq.com>
This commit is contained in:
@@ -243,6 +243,7 @@ export const parseLLMStreamResponse = () => {
|
||||
// 结束时,返回所有剩余内容
|
||||
if (isStreamEnd) {
|
||||
const content = citeBuffer + text;
|
||||
citeBuffer = ''; // 清空缓冲区,避免重复输出
|
||||
return {
|
||||
content: removeDatasetCiteText(content, false)
|
||||
};
|
||||
|
Reference in New Issue
Block a user