`import json:lib/json.mq.md` binds file libraries; `import fmt:time.format` binds member short names (replaces `> use`). Legacy `> path.mq.md` / `> use` now hard-error with a hint. Migrates repo docs, skills, ext, lib, public, examples, man-test and tests; adds a negative gold and updates view/catalog rendering. Co-authored-by: Cursor <cursoragent@cursor.com>
582 B
582 B
title: openai SSE parse offline import net:lib/net.mq.md import json:lib/json.mq.md
main
*fixture = "data: {"choices":[{"delta":{"content":"Hel"}}]}\n\ndata: {"choices":[{"delta":{"content":"lo"}}]}\n\ndata: [DONE]\n" *
*events = > net.openai_sse_parse text=fixture *
ev*t= > json.get value=evkey=type *t== "delta" *chunk= > json.get value=evkey=text *
print text=
chunkt== "done" *answer= > json.get value=evkey=result *
print text=
answerprint text=bad