generated from n8n-io/n8n-nodes-starter
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,52 @@ | ||
![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png) | ||
|
||
# n8n-nodes-starter | ||
# n8n-nodes-gpt-tokenizer | ||
|
||
This repo contains example nodes to help you get started building your own custom integrations for [n8n](n8n.io). It includes the node linter and other dependencies. | ||
# Work with BPE Tokens in n8n | ||
|
||
To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry). | ||
This community package contains a node to work with BPE Tokens such as OpenAI's GPT models use under the hood. | ||
As a matter of fact this node works just fine with the OpenAI Node. | ||
|
||
## Prerequisites | ||
You can: | ||
* Encode a string into BPE Tokens (may be cool for custom training) | ||
* Decode an array of BPE Tokens back to a string (for funzies?) | ||
* Determine a strings token length before submitting to the OpenAI API | ||
* Split a text into chunks which match exactly a definable Token Limit | ||
|
||
You need the following installed on your development machine: | ||
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform. | ||
|
||
* [git](https://git-scm.com/downloads) | ||
* Node.js and npm. Minimum version Node 16. You can find instructions on how to install both using nvm (Node Version Manager) for Linux, Mac, and WSL [here](https://github.com/nvm-sh/nvm). For Windows users, refer to Microsoft's guide to [Install NodeJS on Windows](https://docs.microsoft.com/en-us/windows/dev-environment/javascript/nodejs-on-windows). | ||
* Install n8n with: | ||
``` | ||
npm install n8n -g | ||
``` | ||
* Recommended: follow n8n's guide to [set up your development environment](https://docs.n8n.io/integrations/creating-nodes/build/node-development-environment/). | ||
[Supported Operations](#supported-operations) | ||
[Installation](#installation) | ||
[Compatibility](#compatibility) | ||
[About](#about) | ||
[Version History](#version-history) | ||
|
||
## Supported Operations | ||
|
||
## Using this starter | ||
| Operation | Description | Options | | ||
| ------------- | ------------- | ------------- | | ||
| Encode | Encode a string into BPE Tokens. Returns an array of Tokens. | - | | ||
| Decode | Decode an array of BPE Tokens into a string. Returns a string. | - | | ||
| Count Tokens | Count the tokens a string produces. Return a the number of tokens. | - | | ||
| Check Token Limit | Wheather a given string exceeds a defined Token Limit. Returns a boolean. | Optional: Create an error if the Token Limit is exceeded. | | ||
| Slice to Max Token Limit | Slice the string into block which match exactly the provided token limit. Returns an array of strings. | - | | ||
|
||
These are the basic steps for working with the starter. For detailed guidance on creating and publishing nodes, refer to the [documentation](https://docs.n8n.io/integrations/creating-nodes/). | ||
## Installation | ||
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation. | ||
It also should automatical install this depency: https://www.npmjs.com/package/gpt-tokenizer, which is a port of the original BPE Token Python Library. | ||
|
||
1. [Generate a new repository](https://github.com/n8n-io/n8n-nodes-starter/generate) from this template repository. | ||
2. Clone your new repo: | ||
``` | ||
git clone https://github.com/<your organization>/<your-repo-name>.git | ||
``` | ||
3. Run `npm i` to install dependencies. | ||
4. Open the project in your editor. | ||
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes. | ||
6. Update the `package.json` to match your details. | ||
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible. | ||
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance. | ||
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started. | ||
10. Update the LICENSE file to use your details. | ||
11. [Publish](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry) your package to npm. | ||
## Compatibility | ||
|
||
## More information | ||
The Latest Version of n8n. If you encounter any problem, feel free to [open an issue](https://github.com/geckse/n8n-nodes-ninox) on Github. | ||
|
||
Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes. | ||
## About | ||
|
||
## License | ||
<img src="https://let-the-work-flow.com/content/uploads/logo-let-the-work-flow-signet-quad-150x150.png" align="left" height="74" width="74"> | ||
<br> | ||
Hi I'm geckse and I let your work flow! 👋 | ||
I hope you are enyoing these nodes. If you are in need of a smooth automation, steady integration or custom code check my page: https://let-the-work-flow.com | ||
|
||
[MIT](https://github.com/n8n-io/n8n-nodes-starter/blob/master/LICENSE.md) | ||
## Version History | ||
|
||
### 0.1.0 | ||
- initial release |