Google Gemini 聊天模型节点(Google Gemini Chat Model node)#
使用 Google Gemini Chat Model 节点可将 Google 的 Gemini 聊天模型与对话代理配合使用。
🌐 Use the Google Gemini Chat Model node to use Google's Gemini chat models with conversational agents.
本页提供 Google Gemini Chat Model 节点的参数以及更多资源的链接。
🌐 On this page, you'll find the node parameters for the Google Gemini 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 会从 Google Gemini API 动态加载模型,你只会看到你账户可用的模型。
🌐 n8n dynamically loads models from the Google Gemini API and you'll only see the models available to your account.
节点选项(Node options)#
- 最大令牌数:输入使用的最大令牌数,这将设置完成的长度。
- 采样温度:使用此选项来控制采样过程的随机性。较高的温度会产生更为多样化的采样,但也会增加出现偏差的风险。
- Top K:输入模型用于生成下一个标记的标记选择数量。
- Top P:使用此选项设置完成时应使用的概率。使用较低的值可以忽略不太可能的选项。
- 安全设置:Gemini 支持可调节的安全设置。有关可用过滤器和级别的信息,请参考 Google 的 Gemini API 安全设置。
局限性(Limitations)#
不支持代理(No proxy support)#
Google Gemini 聊天模型节点使用 Google 的 SDK,该 SDK 不支持代理配置。
🌐 The Google Gemini Chat Model node uses Google's SDK, which doesn't support proxy configuration.
如果你需要代理你的连接,作为一种解决方法,你可以为 Gemini 请求设置一个专用反向代理,并将你的 Google Gemini 凭证 中的 Host 参数更改为指向你的代理地址:
🌐 If you need to proxy your connection, as a work around, you can set up a dedicated reverse proxy for Gemini requests and change the Host parameter in your Google Gemini credentials to point to your proxy address:
模板和示例(Templates and examples)#
相关资源(Related resources)#
有关该服务的更多信息,请参阅 LangChain 的 Google Gemini 文档。
🌐 Refer to LangChain's Google Gemini documentation for more information about the service.
View n8n's Advanced AI documentation.
