npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-eksido-chatgpt

v1.0.24

Published

A Node-RED node that integrates with ChatGPT API

Downloads

53

Readme

node-red-contrib-eksido-chatgpt

A Node-RED module that integrates with OpenAI's GPT-3 API and OpenAI Chat API.

This module includes two nodes:

  • chatgpt: A node that interacts with GPT-3 API for generating text completions.
  • openai-chat: A node that interacts with OpenAI Chat API for multi-turn conversations.

Installation

Run the following command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-eksido-chat

Usage

chatgpt Node

  1. Add the chatgpt node to your Node-RED flow.
  2. Double-click on the node to configure the required parameters:
    • API Key: Your OpenAI API key.
    • Max Tokens: The maximum number of tokens (words) in the generated text.
    • Num Responses: The number of responses to generate.
    • Stop Sequences: The character sequences to stop generating text.
    • Temperature: Controls the randomness of the generated text.
  3. Connect the input and output of the chatgpt node to other nodes as needed.
  4. Deploy your flow.

openai-chat Node

  1. Add the openai-chat node to your Node-RED flow 2. Double-click on the node to configure the required parameters:
    • API Key: Your OpenAI API key.
    • Model: The model to use for generating responses (e.g., "gpt-3.5-turbo").
  2. Connect the input and output of the openai-chat node to other nodes as needed.
  3. Deploy your flow.

Input

For both nodes, the input message payload should be a string.

chatgpt Node

  • The input message payload is the prompt for the GPT-3 API.

openai-chat Node

  • The input message payload is the content of the user message to the Chat API.

Output

The output message payload will be an array of generated text for the chatgpt node and an array of generated messages for the openai-chat node. You can use other nodes in your flow to process these outputs as needed.

Example

Here's a simple example of using the chatgpt node in a flow:

  1. Add an inject node with a string payload (e.g., "Translate the following English text to French: 'Hello, how are you?'").
  2. Connect the inject node to a chatgpt node configured with your OpenAI API key and desired parameters.
  3. Connect the chatgpt node to a debug node to display the generated text.
  4. Deploy your flow and click on the inject node to trigger the GPT-3 API request.

For the openai-chat node, the flow would be similar, with the input message payload containing the content of the user message for the Chat API.

  1. Add an inject node with a string payload (e.g., "Tell me a joke.").
  2. Connect the inject node to an openai-chat node configured with your OpenAI API key and desired model.
  3. Connect the openai-chat node to a debug node to display the generated chat messages.
  4. Deploy your flow and click on the inject node to trigger the OpenAI Chat API request.

License

MIT License