Wrapper around Groq API for large language models fine-tuned for chat

Groq API is compatible to the OpenAI API with some limitations. View the full API ref at:

Link

To use, you should have the GROQ_API_KEY environment variable set.

Example

const model = new ChatGroq({
temperature: 0.9,
apiKey: process.env.GROQ_API_KEY,
});

const response = await model.invoke([new HumanMessage("Hello there!")]);
console.log(response);

Hierarchy

Constructors

Properties

client: Groq
modelName: string = "llama2-70b-4096"
temperature: number = 0.7

Methods

  • Parameters

    • request: ChatCompletionCreateParamsStreaming
    • Optional options: any

    Returns Promise<AsyncIterable<ChatCompletionChunk>>

  • Parameters

    • request: ChatCompletionCreateParamsNonStreaming
    • Optional options: any

    Returns Promise<ChatCompletion>

Generated using TypeDoc