[分享创造] 分享一个基于 JSON 片段流的增量解析器(Go)

·

最近在 LLM Stream 场景下踩了个坑:

模型输出的是 JSON ,但要等完整闭合才能处理,前端体验很差。

就试着写了个基于 JSON 片段流的增量解析器,可以在对象还没完全生成完时就触发回调处理。

顺手开源了一下,记录一次工程实践。

https://github.com/codeforgee/stream

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *