跳到主要内容

IBM

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

IBM 捆绑包提供了对用于文本和嵌入生成的 IBM watsonx.ai 模型的访问。 这些组件需要 IBM watsonx.ai 部署和 watsonx API 凭据。

IBM watsonx.ai

IBM watsonx.ai 组件使用 IBM watsonx.ai受支持的基础模型 生成文本。 要使用网关模型,请使用 OpenAI 文本生成组件 以及网关模型的 OpenAI 兼容端点。

您可以在流中任何需要语言模型的地方使用 IBM watsonx.ai 组件。

使用 IBM watsonx.ai 组件作为核心语言模型组件的基础提示流。

IBM watsonx.ai 参数

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

名称类型描述
urlString输入参数。您部署区域的 watsonx API 基础 URL
project_idString输入参数。您的 watsonx 项目 ID
api_keySecretString输入参数。用于验证对指定 watsonx.ai 部署和模型访问权限的 watsonx API 密钥
model_nameString输入参数。要使用的 watsonx 模型名称。选项从 API 动态获取。
max_tokensInteger输入参数。要生成的最大标记 (tokens) 数。默认值:1000
stop_sequenceString输入参数。生成应停止的序列。
temperatureFloat输入参数。控制输出的随机性。默认值:0.1
top_pFloat输入参数。控制核采样,限制模型仅考虑概率在 top_p 值以下的标记。默认值:0.9
frequency_penaltyFloat输入参数。控制频率惩罚。正值会降低重复标记的概率,负值会增加概率。默认值:0.5
presence_penaltyFloat输入参数。控制存在惩罚。正值会增加引入新话题的可能性。默认值:0.3
seedInteger输入参数。模型的随机种子。默认值:8
logprobsBoolean输入参数。是否返回输出标记的对数概率。默认值:true
top_logprobsInteger输入参数。在每个位置返回的最有可能标记的数量。默认值:3
logit_biasString输入参数。用于偏向或抑制标记 ID 的 JSON 字符串。

IBM watsonx.ai 输出

IBM watsonx.ai 组件可以输出 模型响应 (Model Response) (消息 (Message)) 或 语言模型 (Language Model) (语言模型 (LanguageModel))。

当您想将 IBM watsonx.ai 模型用作另一个 LLM 驱动组件(如 Agent智能转换 (Smart Transform) 组件)的 LLM 时,请使用 语言模型 (Language Model) 输出。 有关更多信息,请参阅 语言模型组件

来自 IBM watsonx.ai 组件的 LanguageModel 输出是根据 组件参数 配置的 ChatWatsonx (https://docs.langchain.com/oss/python/integrations/chat/ibm_watsonx) 实例。

IBM watsonx.ai 嵌入 (IBM watsonx.ai Embeddings)

IBM watsonx.ai Embeddings 组件使用 IBM watsonx.ai受支持的基础模型 进行嵌入生成。

输出是使用 WatsonxEmbeddings 生成的 嵌入 (Embeddings)

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

使用 IBM watsonx.ai Embeddings 组件的基础嵌入生成流

IBM watsonx.ai 嵌入参数

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

名称显示名称信息
urlwatsonx API 端点输入参数。您部署区域的 watsonx API 基础 URL
project_idwatsonx 项目 ID输入参数。您的 watsonx 项目 ID
api_keyAPI Key输入参数。用于验证对指定 watsonx.ai 部署和模型访问权限的 watsonx API 密钥
model_name模型名称 (Model Name)输入参数。要使用的嵌入模型名称。支持 默认嵌入模型,并在连接到您的 watsonx.ai 部署后自动更新。
truncate_input_tokens截断输入标记 (Truncate Input Tokens)输入参数。要处理的最大标记数量。默认值:200
input_text在输出中包含原始文本输入参数。确定原始文本是否包含在输出中。默认值:true

默认嵌入模型

默认情况下,IBM watsonx.ai Embeddings 组件支持以下默认模型:

  • sentence-transformers/all-minilm-l12-v2: 384 维嵌入
  • ibm/slate-125m-english-rtrvr-v2: 768 维嵌入
  • ibm/slate-30m-english-rtrvr-v2: 768 维嵌入
  • intfloat/multilingual-e5-large: 1024 维嵌入

在输入您的 API 端点和凭据后,组件会自动从您的 watsonx.ai 部署中获取可用模型列表。

另请参阅

Search