Files
marqdo/tests/lib/net-openai-sse.mq.md
T
cflmyandCursor ecc92f473a Unify frontmatter imports as import bind:target and drop > imports.
`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>
2026-08-13 10:03:21 +08:00

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=ev key=type *
    1. t == "delta" *chunk = > json.get value=ev key=text *

    print text=chunk

    1. t == "done" *answer = > json.get value=ev key=result *

    print text=answer

    print text=bad