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
- 模型:选择用于生成补全的模型。
¥Model: Select the model to use to generate the completion.
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
- 最大令牌数:请输入使用的最大令牌数,这将设置完成时长。
¥Maximum Number of Tokens: Enter the maximum number of tokens used, which sets the completion length.
- 采样温度:使用此选项可控制采样过程的随机性。更高的温度会产生更多样化的采样,但会增加出现幻觉的风险。
¥Sampling Temperature: Use this option to control the randomness of the sampling process. A higher temperature creates more diverse sampling, but increases the risk of hallucinations.
- 顶部 K:输入模型用于生成下一个令牌的令牌选择数。
¥Top K: Enter the number of token choices the model uses to generate the next token.
- 顶部 P:使用此选项可设置完成概率。使用较低的值来忽略可能性较小的选项。
¥Top P: Use this option to set the probability the completion should use. Use a lower value to ignore less probable options.
- 安全设置:Gemini 支持可调节的安全设置。更多信息请参阅 Google 的 Gemini API 安全设置 文档,了解有关可用过滤器和级别的信息。
¥Safety Settings: Gemini supports adjustable safety settings. Refer to Google's Gemini API safety settings for information on the available filters and levels.
局限性#
¥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.
