TypeScript streaming
Beta
Target SDK design
typescript
import { BotConnectorClient } from "@botconnector/sdk";
const client = new BotConnectorClient();
const model = await client.llm("<publisher>/<model>");
for await (const chunk of model.stream("Explain GGUF")) {
process.stdout.write(chunk.text);
}The source SDK is implemented and live-tested, but no npm package is published yet.
Working today via OpenAI-compatible API
typescript
import OpenAI from "openai";
const client = new OpenAI({ baseURL: "http://127.0.0.1:11435/v1", apiKey: "not-needed" });
const stream = await client.chat.completions.create({
model: "<publisher>/<model>",
messages: [{ role: "user", content: "Explain GGUF" }],
stream: true,
});
for await (const chunk of stream) {
const delta = chunk.choices[0]?.delta?.content;
if (delta) process.stdout.write(delta);
}Wire format: Streaming.