Skip to main content
Groq is a company that offers fast AI inference, powered by LPU™ AI inference technology which delivers fast, affordable, and energy efficient AI. This will help you getting started with Groq chat models. For detailed documentation of all ChatGroq features and configurations head to the API reference.

概述

集成详情

模型功能

请参阅下表标题中的链接,了解如何使用特定功能。

设置

要访问 ChatGroq models,你需要create a Groq account, get an API key, and install the @langchain/groq integration package.

凭证

In order to use the Groq API you’ll need an API key. Sign up for a Groq account and create an API key. Then, you can set the API key as an environment variable in your terminal:
如果你想要自动追踪模型调用,还可以设置你的 LangSmith API 密钥,取消注释以下内容:

安装

LangChain 的 ChatGroq 集成位于 @langchain/groq 包中:

实例化

现在我们可以实例化模型对象并生成聊天补全:

调用

Json invocation


API 参考

有关所有 ChatGroq 功能和配置的详细文档,请前往 API 参考