ChatGTP-NODE-JS-API-CALL
A simple Node.js function to call the ChatGTP endpoint.
Installation
To install the package, run the following command:
npm install chatgtp-node-js-api-call
npm install axios
Usage
To use the package, import the chatGTP
function and call it with your question and API key.
const { chatGTP } = require('chatgtp-node-js-api-call')
async function chatWithGTP() {
const question = 'What is the capital of France?'
const apiKey = 'YOUR_OPEN_API_KEY'
const completion = await chatGTP(question, apiKey)
console.log(completion.content)
}