@leaf/parse-think@0.1.1Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
latest
LeafYeeXYZ/ParseThinkWorks with
•JSR Score100%•This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers




Downloads3/wk
•Publisheda year ago (0.1.1)
Parse think process of LLMs like DeepSeek-R1 and return the clean result and the think process.
ParseThink
Parse think process of LLMs like DeepSeek-R1 and return the clean result and the think process.
Usage
import OpenAI from 'npm:openai' import parse from 'jsr:@leaf/parse-think' const ai = new OpenAI({ baseUrl: 'https://api.deepseek.com/v1', apiKey: '<YOUR_API_KEY>', }) const res = await ai.chat.completions.create({ model: 'deepseek-reasoner', messages: [ { role: 'user', content: 'What is the result of 2 + 2 * 2?' }, ], }) const { content, think } = parse(res.choices[0].message) console.log('Content:', content) console.log('Think:', think)
Built and signed on
GitHub Actions
Add Package
deno add jsr:@leaf/parse-think
Import symbol
import parse_think from "@leaf/parse-think";
Import directly with a jsr specifier
import parse_think from "jsr:@leaf/parse-think";