"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "Groq", {
    enumerable: true,
    get: function() {
        return Groq;
    }
});
const _env = require("@llamaindex/env");
const _openai = require("./openai.js");
class Groq extends _openai.OpenAI {
    constructor(init){
        const { apiKey = (0, _env.getEnv)("GROQ_API_KEY"), additionalSessionOptions = {}, model = "mixtral-8x7b-32768", ...rest } = init ?? {};
        if (!apiKey) {
            throw new Error("Set Groq Key in GROQ_API_KEY env variable"); // Tell user to set correct env variable, and not OPENAI_API_KEY
        }
        additionalSessionOptions.baseURL = additionalSessionOptions.baseURL ?? "https://api.groq.com/openai/v1";
        super({
            apiKey,
            additionalSessionOptions,
            model,
            ...rest
        });
    }
}
