import { Textql } from "@textql/sdk";
import { createStreamingClient } from "@textql/sdk/streaming";
const client = new Textql({ apiKey, serverURL: "https://app.textql.com/rpc/public" });
const streaming = createStreamingClient({ apiKey });
const sent = await client.chats.send({ body: { chatId, message: "..." } });
for await (const cell of streaming.chats.streamChat({
chatId,
latestCompleteCellId: sent.cellId,
})) {
render(cell); // typed Cell — loop exits when the run completes
}