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

@sumit_shinde_84/node-red-contrib-node-gpt

v1.0.6

Published

Node-RED node to interact with chatgpt

Downloads

19

Readme

overview

Inquires ChatGPT from the payload string.

install

npm i node-red-contrib-simple-chatgpt

or

Install from the node-red pallete manager

How to use

Input items

|Item|Description| |--|--| |Token|Set the API key for OpenAPI, also you can set token dynamically by msg.token | |Model|Specifies the model name to use. The default is gpt-3.5-turbo. | |SystemSetting|Describe the AI assistant settings.| |pastMessages|Passes conversation history. Required to continue the conversation. | |functions|Can be used from gpt-3.5-turbo-0613 or later. Specified samples are sold separately. | You can forcibly execute the function name specified by |function_call|functions. If you set it to auto, the function will be automatically determined and called. If it is none, it will not be called. Specifying {name: function name} will force execution of the target function. |

Output items

|Item|Description| |--|--| |payload|You will receive a ChatGPT response. If the function is executed, null is returned. | |pastMessages|Returns a history array of conversations. | When executed with |payloadFunction|FunctionCalling, the executed function name and JSON parsed arguments are returned. |

How to specify Functions

A sample of Functions is shown below. Specify the function name, function details, and parameters in array format.

|Item|Description| |--|--| |name|Name of the function. You can choose any name you like. | |description|Detailed description of the function. It is preferable to write in some detail. | |parameters.properties|Parameters details. Enter the property name, type, and description you want to set. | |parameters.required| Specify the required property name that you want returned in the property. |

[
     {
         "name": "get_weather",
         "description": "Get the weather for the specified location and date",
         "parameters": {
             "type": "object",
             "properties": {
                 "location": {
                     "type": "string",
                     "description": "Name of prefecture, city, or town, e.g. London"
                 },
                 "date": {
                     "type": "string",
                     "description": "Date formatted in YYYY/MM/DD, e.g. 2023/06/13"
                 }
             },
             "required": [
                 "location",
                 "date"
             ]
         }
     },
     {
         "name": "recommend_book",
         "description": "Introduce one recommended book",
         "parameters": {
             "type": "object",
             "properties": {
                 "title": {
                     "type": "string",
                     "description": "Book title"
                 },
                 "description": {
                     "type": "string",
                     "description": "Book contents"
                 }
             },
             "required": [
                 "title",
                 "description"
             ]
         }
     },
     {
         "name": "hashtag_text",
         "description": "Output a hashtag from the text provided by the user.",
         "parameters": {
             "type": "object",
             "properties": {
                 "tag": {
                     "type": "string",
                     "description": "Please output at least 3 hashtags."
                 }
             },
             "required": [
                 "tag"
             ]
         }
     }
]

For details on how to specify, please see here.

How to specify function_call

In addition to auto or none as a string, specify the name of the function to be forcibly executed on the Json object. This is an example when the above Functions are given. hashtag_text is now forced.

{
     "name": "hashtag_text"
}