mirror of
https://github.com/run-llama/LlamaIndexTS.git
synced 2026-07-21 23:05:25 -04:00
6d4d96f8fe
Co-authored-by: Marcus Schiesser <mail@marcusschiesser.de>
14 lines
371 B
TypeScript
14 lines
371 B
TypeScript
import { ReplicateLLM } from "@llamaindex/replicate";
|
|
|
|
(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");
|
|
})();
|