1.1.1 • Published 12 months ago

@mi-gpt/stream v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

@mi-gpt/stream

MiGPT 长文本自动分片 + 流式响应

import { StreamResponse } from "@mi-gpt/stream";

async function main() {
  const stream = new StreamResponse();
  setTimeout(() => {
    stream.write("你好");
    stream.write("世界");
    stream.flush(); // 或取消 stream.cancel();
  }, 1000);
  const result = await stream.result();
  console.log(result);
}

main();
1.1.1

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago