Skip to content

阿里云聊天模型节点(Alibaba Cloud chat model node)#

阿里云聊天模型节点将聊天提示发送到阿里云的会话模型,用于高级 AI 链和 LangChain 集成。使用它可以生成对话响应,将模型输出集成到工作流中,或使用自定义采样、重试和超时设置运行提示。

🌐 The Alibaba Cloud Chat Model node sends chat prompts to Alibaba Cloud's conversational models, for advanced AI chains and LangChain integrations. Use it to generate conversational responses, integrate model outputs into workflows, or run prompts with custom sampling, retry, and timeout settings.

凭证

你可以在这里找到此节点的认证信息。

Parameter resolution in sub-nodes

Sub-nodes behave differently to other nodes when processing multiple items using an expression.

Most nodes, including root nodes, take any number of items as input, process these items, and output the results. You can use expressions to refer to input items, and the node resolves the expression for each item in turn. For example, given an input of five name values, the expression {{ $json.name }} resolves to each name in turn.

In sub-nodes, the expression always resolves to the first item. For example, given an input of five name values, the expression {{ $json.name }} always resolves to the first name.

操作(Operations)#

生成聊天回复(Generate chat response)#

从所选的阿里云模型生成聊天风格的回应。

🌐 Generate a chat-style response from the selected Alibaba Cloud model.

参数

选项

  • 频率惩罚 (类型:数字,字段:frequencyPenalty):正值会根据新令牌出现的频率进行惩罚,从而降低模型逐字重复同一行的可能性。默认值:0
  • 最大令牌数(类型:number,字段:maxTokens):在完成中生成的最大令牌数。限制取决于所选模型。值为负一时使用模型的默认限制。默认值:-1
  • 响应格式 (类型:选项,字段:responseFormat):节点返回的输出格式,例如纯文本或结构化格式。默认值:文本。
  • 出现惩罚(类型:number,字段:presencePenalty):正值会根据新生成的词是否在已有文本中出现进行惩罚,从而增加模型讨论新话题的可能性。默认值:0
  • 采样温度(类型:数字,字段:temperature):控制随机性。较低的值会使输出较不随机,接近零时为确定性。默认值:0.7
  • 超时 (类型:数字,字段:timeout):请求被中止前允许的最长时间(毫秒)。默认值:360000
  • 最大重试次数(类型:number,字段:maxRetries):失败请求的最大重试次数。默认值:2
  • Top P(类型:数字,字段:topP):控制多样性的核心采样参数。0.5意味着考虑概率质量的一半。调整Top P采样温度,但不要同时调整。默认值:1

模板和示例(Templates and examples)#

Template widget placeholder.

有关可用模型及其功能的更多信息,请参阅 阿里云模型工作室 — 模型

🌐 Refer to Alibaba Cloud Model Studio — Models for more information about available models and their capabilities.