import { InferenceClient } from "@huggingface/inference"; let out = ""; const stream = client.chatCompletionStream({ provider: "hf-inference", model: "Qwen/Qwen3-235B-A22B", messages: [ { role: "user", content: "你是谁?", }, { role: "assistant", content: "", }, ], temperature: 1.2, max_tokens: 50000, top_p: 0.6, response_format: undefined }); for await (const chunk of stream) { if (chunk.choices && chunk.choices.length > 0) { const newContent = chunk.choices[0].delta.content; out += newContent; console.log(newContent); } }