找出流收集器里的 bug

来自 本地大语言模型
Ollama 0.33.3 · llama.cpp 0.3.0 · Python 3.14 进阶 4分钟 找出 1处问题

找出这段生成的 Ollama 流收集器中的完成状态错误。

Python
import json

def collect(response):
    parts = []
    for line in response:
        event = json.loads(line)
        parts.append(event.get("response", ""))
    return "".join(parts)
在试验场中打开
报告错误