Inside italic/bold code segments every bare word is a variable — including call arguments and method-call receivers — so text literals must be quoted and receivers no longer need backticks. A bare dotted callee `a.b` resolves as a method call when `a` is a local variable, otherwise as a library path (Python-style unified namespace), in both the tree-walk and bytecode backends. Migrate ~70 tests plus ext/web, ext/quantum, ext/ai and the example projects to the new idiom; update SKILL.md and the design docs; fix the web/quantum example data model (db/index.mq.md). Unit and gold suites pass; only the 3 network-live tests fail offline. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
919 B
Markdown
33 lines
919 B
Markdown
---
|
|
title: openai SSE reasoning_content offline
|
|
description: DeepSeek-style thinking streams as type=reasoning; answer stays delta/done.result.
|
|
import net:lib/net.mq.md
|
|
import json:lib/json.mq.md
|
|
---
|
|
|
|
# main
|
|
|
|
*fixture = "data: {\"choices\":[{\"delta\":{\"reasoning_content\":\"think\"}}]}\n\ndata: {\"choices\":[{\"delta\":{\"content\":\"Hi\"}}]}\n\ndata: [DONE]\n"*
|
|
|
|
*events = > net.openai_sse_parse text=`fixture`*
|
|
*n = > len value=`events`*
|
|
> print text=`n`
|
|
|
|
*e0 = > at value=`events` index=0*
|
|
*t0 = > json.get value=`e0` key="type"*
|
|
*x0 = > json.get value=`e0` key="text"*
|
|
> print text=`t0`
|
|
> print text=`x0`
|
|
|
|
*e1 = > at value=`events` index=1*
|
|
*t1 = > json.get value=`e1` key="type"*
|
|
*x1 = > json.get value=`e1` key="text"*
|
|
> print text=`t1`
|
|
> print text=`x1`
|
|
|
|
*e2 = > at value=`events` index=2*
|
|
*t2 = > json.get value=`e2` key="type"*
|
|
*r2 = > json.get value=`e2` key="result"*
|
|
> print text=`t2`
|
|
> print text=`r2`
|