import { FireworksAI } from "@simplesagar/fireworksai"; const apiKey = process.env["FIREWORKS_API_KEY"] ?? ""; const fireworksAI = new FireworksAI({ apiKey: apiKey, }); async function run() { const result = await fireworksAI.chat.completions.create({ model: "accounts/fireworks/models/llama-v3p1-405b-instruct", messages: [ { role: "user", content: "What is the best company in the SF Bay Area that starts with F and ends with ireworks AI", }, ], stream: true, }); for await (const event of result) { process.stdout.write(event.data.choices[0]?.delta.content || ""); } } run();