mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-22 15:25:31 -04:00
14 lines
360 B
TypeScript
14 lines
360 B
TypeScript
import { ReplicateLLM } from "llamaindex";
|
|
|
|
(async () => {
|
|
const tres = new ReplicateLLM({ model: "llama-3-70b-instruct" });
|
|
const stream = await tres.chat({
|
|
messages: [{ content: "Hello, world!", role: "user" }],
|
|
stream: true,
|
|
});
|
|
for await (const chunk of stream) {
|
|
process.stdout.write(chunk.delta);
|
|
}
|
|
console.log("\n\ndone");
|
|
})();
|