The Noob - API and Back Again

Hello All

I as you may have guessed I am new to all this API and AI stuff!

But being an eager sort, I throw myself in and try to figure things out as I go (not always the best strategy I’ll admit).

I am looking for a bit of help, a steer in the right direction.

I am wanting to create a couple of different API calls to OpenAI Davinci and I am having a bit of trouble getting them to work.

I am wanting to use a form on the frontend for a user to make a submission that will then form part of the prompt for the API request.

I have a Wordpress website on a server that has Plesk as it’s OS.

I have tried to install the Python libraries and NodeJs through SSH terminal without success.

I have found that there is a NodeJS extension for Plesk and so I have installed that and then the OpenAI Repository from GitHub.

My understanding is that to make each app work I need a few components:

  1. A Form on the front end for the user submission (I have an html form for that)
  2. Some JS to listen for the form submission and to send the submitted data to the app, and to listen for the response and to then render that on the page.
  3. A file (let’s call it (openai1) on the server to collect the form data and create the API request to send to the app startup file
  4. The app startup file (app.js) to handle the actual request

Am I on the right lines here? I think I can do the first step ok, but then I fall down!

Thank you for reading, your guidance, suggestions will be much appreciated.