跳到主要内容

Cohere

捆绑包 (Bundles) 包含支持 Langflow 与特定第三方集成自定义组件。

本页面介绍了 Cohere 捆绑包中可用的组件。

有关 Cohere 组件使用的 Cohere 特性和功能的更多信息,请参阅 Cohere 文档。

Cohere 文本生成 (Cohere text generation)​

此组件使用 Cohere 的语言模型生成文本。

它可以输出 模型响应 (Model Response) (Message) 或 语言模型 (Language Model) (LanguageModel)。

当您想将 Cohere 模型用作另一个 LLM 驱动的组件(如 代理 (Agent) 或 智能转换 (Smart Transform) 组件)的 LLM 时,请使用 语言模型 输出。

有关更多信息,请参阅 语言模型组件。

Cohere 文本生成参数​

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

名称类型描述
InputString输入参数。指定用于文本生成的输入文本。
System MessageString输入参数。传递给模型的 系统消息。
StreamBoolean输入参数。是否流式传输响应。仅在聊天中有效。默认值:false。
Cohere API KeySecretString输入参数。您的 Cohere API 密钥。
TemperatureFloat输入参数。指定采样的随机性。较低的值(接近 0)更具确定性,较高的值(接近 1)更具创造性。默认值:0.75。

Cohere 嵌入 (Cohere Embeddings)​

Cohere 嵌入 组件用于加载来自 Cohere 的嵌入模型。

有关在流中使用嵌入模型组件的更多信息,请参阅 嵌入模型组件。

Cohere 嵌入参数​

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

名称类型描述
cohere_api_keySecretString输入参数。与 Cohere 服务进行身份验证所需的 API 密钥。
modelString输入参数。用于嵌入文本文件和执行查询的语言模型。默认值:embed-english-v2.0
truncateBoolean输入参数。如何处理超过模型 token 限制的输入。选项为 NONE、START 或 END(默认)。有关更多信息,请参阅 Cohere truncate API 参考。
max_retriesInteger输入参数。失败请求的最大重试次数。默认值:3
user_agentString输入参数。请求中包含的用户代理字符串。默认值:langchain
request_timeoutFloat输入参数。请求的超时时长(以秒为单位)。默认值:无

Cohere 重排序 (Cohere Rerank)​

此组件使用 Cohere API 查找并对文档进行重排序。

输出包含重排序文档的 Data,受 Top N 参数限制。

Cohere 重排序参数​

Some parameters are hidden by default in the visual editor. You can modify all parameters through the Controls in the component's header menu.

名称类型描述
搜索查询String输入参数。重排序文档的搜索查询。
搜索结果Data输入参数。连接来自向量存储组件的搜索结果输出。在对向量数据库运行相似性搜索后,使用此参数应用重排序。
Top NInteger输入参数。重排序后要返回的文档数量。默认值:3。
Cohere API KeySecretString输入参数。您的 Cohere API 密钥。
模型String输入参数。要使用的重排序模型。默认值:rerank-english-v3.0
Search