Node for GPT-3 Open AI

Hello everyone,

I am trying to use Open AI on Node Red:
I have not found any available Node.
I have seen that OpenAI has an official Node.js library, and Python also:

You are the experts in Node Red, would it be interesting to create a new Node to use it directly in Node Red?
Or do you suggest using it with HTTP POST?

I don't know how to create nodes, I'm just starting in Node Red :wink:


1 Like

If you set:

    /** Allow the Function node to load additional npm modules directly */
    functionExternalModules: true,

in settings.js (restart node-red), you can use the "setup" tab in a function node, it will import the nodejs library directly for use within the function node.

Thank you for your help @bakman2 :wink:

I´m novice with Node Red...
I followed your instructions and right now is allow Externals Modules in Function Node.

How I can transfer or pass the parameters to this nodejs openai module in the Function Module?
I did not understand well, how should I use it? :confused:

Could you help me with an example?

I would use HTTP POST.
Following page specifies how to construct such a HTTP POST request: