diff --git a/examples/portkey.ts b/examples/portkey.ts new file mode 100644 index 0000000000000000000000000000000000000000..4221b4b16650ea0ca1cf122c84fcbc20f23fba70 --- /dev/null +++ b/examples/portkey.ts @@ -0,0 +1,23 @@ +import { Portkey } from "llamaindex"; + +(async () => { + const llms = [{ + + }] + const portkey = new Portkey({ + mode: "single", + llms: [{ + provider:"anyscale", + virtual_key:"anyscale-3b3c04", + model: "meta-llama/Llama-2-13b-chat-hf", + max_tokens: 2000 + }] + }); + const result = portkey.stream_chat([ + { role: "system", content: "You are a helpful assistant." }, + { role: "user", content: "Tell me a joke." } + ]); + for await (const res of result) { + process.stdout.write(res) + } +})();