Skip to main content

聊天模型

¥Chat models

聊天模型 是语言模型,以 messages 序列为输入,返回消息作为输出(而不是使用纯文本)。这些通常是较新的模型。

¥Chat models are language models that use a sequence of messages as inputs and return messages as outputs (as opposed to using plain text). These are generally newer models.

info

如果你想编写自己的聊天模型,请参阅 此操作指南。如果你想贡献集成,请参阅 贡献集成

¥If you'd like to write your own chat model, see this how-to. If you'd like to contribute an integration, see Contributing integrations.

Pick your chat model:

Install dependencies

yarn add @langchain/groq 

Add environment variables

GROQ_API_KEY=your-api-key

Instantiate the model

import { ChatGroq } from "@langchain/groq";

const model = new ChatGroq({
model: "llama-3.3-70b-versatile",
temperature: 0
});
await model.invoke("Hello, world!")

¥Featured providers

ModelStreamJSON modeTool CallingwithStructuredOutput()Multimodal
BedrockChat🟡 (Bedrock Anthropic only)🟡 (Bedrock Anthropic only)🟡 (Bedrock Anthropic only)
ChatBedrockConverse
ChatAnthropic
ChatCloudflareWorkersAI
ChatCohere
ChatFireworks
ChatGoogleGenerativeAI
ChatVertexAI
ChatGroq
ChatMistralAI
ChatOllama
ChatOpenAI
ChatTogetherAI
ChatXAI

所有聊天模型

¥All chat models

NameDescription
阿里巴巴统一chatalibabatongyi}
百度千帆chatbaiduqianfan}
深度基础设施chatdeepinfra}
DeepSeek这将帮助你开始使用 DeepSeek 聊天模型。有关 ChatDeepSeek 所有功能和配置的详细文档,请参阅 API 参考。
伪 LLMfake-llm}
友情链接friendli}
Llama CPPllama-cpp}
Minimaxminimax}
Moonshotchatmoonshot}
困惑本指南将帮助你开始使用 Perplexity 聊天模型。有关 ChatPerplexity 所有功能和配置的详细文档,请参阅 API 参考。
PremAIchatprem}
腾讯混元chattencenthunyuan}
WebLLMwebllm}
YandexGPTchatyandexgpt}
ZhipuAIchatzhipuai}