Package Information
Documentation
n8n-nodes-starter
This repo contains example nodes to help you get started building your own custom integrations for n8n. It includes the node linter and other dependencies.
To make your custom node available to the community, you must create it as an npm package, and submit it to the npm registry.
Prerequisites
You need the following installed on your development machine:
- git
- Node.js and pnpm. Minimum version Node 20. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL here. For Windows users, refer to Microsoft's guide to Install NodeJS on Windows.
- Install n8n with:
npm install n8n -g
- Recommended: follow n8n's guide to set up your development environment.
Using this starter
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the documentation.
- Generate a new repository from this template repository.
- Clone your new repo:
git clone https://github.com/<your organization>/<your-repo-name>.git
- Run
npm i
to install dependencies. - Open the project in your editor.
- Browse the examples in
/nodes
and/credentials
. Modify the examples, or replace them with your own nodes. - Update the
package.json
to match your details. - Run
npm lint
to check for errors ornpm lintfix
to automatically fix errors when possible. - Test your node locally. Refer to Run your node locally for guidance.
- Replace this README with documentation for your node. Use the README_TEMPLATE to get started.
- Update the LICENSE file to use your details.
- Publish your package to npm.
More information
Refer to our documentation on creating nodes for detailed information on building your own nodes.
License
n8n-gemini-thinking
这是一个 n8n 社区节点包,提供了 Google Gemini Chat Model 的 thinking 功能支持。
功能特性
- 🧠 Thinking 模式: 支持启用/禁用 thinking 参数,获取模型的内部推理过程
- 🎛️ 多模型支持: 支持 Gemini 1.5 Pro、Flash、Flash-8B 和 2.0 Flash Experimental
- ⚙️ 自定义参数: 支持添加自定义参数到 API 请求
- 🔧 完整配置: 支持温度、最大输出令牌、Top-P、Top-K 等参数调节
- 📝 系统指令: 支持自定义系统指令来指导模型行为
安装
在 n8n 中安装此社区节点包:
- 进入 n8n 设置
- 选择 "社区节点"
- 安装包名:
n8n-nodes-gemini-thinking
或者通过 npm 安装:
npm install n8n-nodes-gemini-thinking
配置
1. 设置 Google Gemini API 凭证
- 在 n8n 中创建新的凭证
- 选择 "Google Gemini API"
- 输入您的 Google Gemini API Key
2. 使用 Gemini Thinking 节点
- 在工作流中添加 "Gemini Thinking" 节点
- 选择您配置的 Gemini API 凭证
- 配置节点参数:
基本参数
- Model: 选择要使用的 Gemini 模型
- Message: 要发送给模型的消息
- Enable Thinking: 启用此选项以获取模型的推理过程
高级参数
- System Instruction: 系统指令,用于指导模型行为
- Temperature: 控制输出的随机性 (0-2)
- Max Output Tokens: 最大输出令牌数 (1-8192)
- Top P: 核采样参数 (0-1)
- Top K: 限制考虑的令牌数量 (1-100)
自定义参数
使用 "Custom Parameters" 部分可以添加额外的自定义参数到 API 请求中。
输出
节点输出包含以下字段:
model
: 使用的模型名称message
: 输入的消息response
: 模型的响应thinking
: 模型的推理过程(仅在启用 thinking 时)usage
: API 使用统计信息rawResponse
: 完整的 API 响应
示例
基本使用
{
"model": "gemini-1.5-pro",
"message": "解释什么是机器学习",
"enableThinking": true,
"temperature": 0.7
}
带自定义参数
{
"model": "gemini-1.5-flash",
"message": "写一首关于春天的诗",
"enableThinking": false,
"customParameters": {
"parameter": [
{
"name": "candidateCount",
"value": "3"
}
]
}
}
开发
构建
npm run build
开发模式
npm run dev
代码格式化
npm run format
代码检查
npm run lint
发布
快速发布
如果您是项目维护者,可以使用提供的发布脚本:
./publish.sh
手动发布
登录 npm:
npm login
更新版本 (可选):
npm version patch # 或 minor, major
发布:
npm publish
详细的发布指南请参考 PUBLISH.md。
版本历史
- 0.1.0: 初始版本
- 支持 Gemini 1.5 Pro/Flash/Flash-8B 和 2.0 Flash Experimental
- 支持 thinking 模式
- 支持自定义参数
- 完整的参数配置选项
许可证
MIT
贡献
欢迎提交 Issue 和 Pull Request!
支持
如果您遇到任何问题,请在 GitHub 上创建 Issue。