Skip to content

xAI Grok 聊天模型节点(xAI Grok Chat Model node)#

使用 xAI Grok Chat Model 节点访问 xAI Grok 的大型语言模型,用于对话式 AI 和文本生成任务。

🌐 Use the xAI Grok Chat Model node to access xAI Grok's large language models for conversational AI and text generation tasks.

在此页面,你可以找到 xAI Grok Chat Model 节点的节点参数以及更多资源的链接。

🌐 On this page, you'll find the node parameters for the xAI Grok Chat Model node, and links to more resources.

凭证

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

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.

节点参数(Node parameters)#

  • 模型:选择将用于生成完成结果的模型。n8n 会动态从 xAI Grok API 加载可用模型。更多信息请参见 xAI Grok 模型文档

节点选项(Node options)#

  • 频率惩罚:使用此选项可以控制模型重复自己内容的可能性。数值越高,模型重复的可能性越低。
  • 最大令牌数:输入使用的最大令牌数,这将设置生成内容的长度。大多数模型的上下文长度为2048个令牌,最新的模型支持最多32,768个令牌。
  • 响应格式:选择 文本JSONJSON 可确保模型返回有效的 JSON。
  • 存在惩罚:使用此选项可以控制模型谈论新话题的概率。数值越高,模型谈论新话题的可能性越大。
  • 采样温度:使用此选项来控制采样过程的随机性。较高的温度会产生更为多样化的采样,但也会增加出现偏差的风险。
  • 超时:输入请求的最大时间(毫秒)。
  • 最大重试次数:输入请求重试的最大次数。
  • Top P:使用此选项设置完成时应使用的概率。使用较低的值可以忽略不太可能的选项。

模板和示例(Templates and examples)#

Template widget placeholder.

}

有关该服务的更多信息,请参阅 xAI Grok 的 API 文档

🌐 Refer to xAI Grok's API documentation for more information about the service.

View n8n's Advanced AI documentation.