Skip to main content

Cohere(Cohere)

Cohere 是一家加拿大初创公司,提供自然语言处理模型,帮助企业改善人机交互。

安装和设置(Installation and Setup)​

  • 安装 Python SDK:
pip install cohere

获取 Cohere API 密钥 并将其设置为环境变量(COHERE_API_KEY)。

LLM​

存在一个 Cohere LLM 包装器,您可以通过以下方式访问: 查看一个 使用示例。

from langchain.llms import Cohere

文本嵌入模型(Text Embedding Model)​

存在一个 Cohere 嵌入模型,您可以通过以下方式访问:

from langchain.embeddings import CohereEmbeddings

有关更详细的步骤,请参阅此笔记本。

检索器(Retriever)​

查看一个 使用示例。

from langchain.retrievers.document_compressors import CohereRerank