chatgtp-node-js-api-call
Version:
A simple javascript function that calls chatGTP endpoint with your input and API Key. Returs ChatGTP's response
27 lines (16 loc) • 623 B
Markdown
A simple Node.js function to call the ChatGTP endpoint.
To install the package, run the following command:
npm install chatgtp-node-js-api-call
npm install axios
To use the package, import the `chatGTP` function and call it with your question and API key.
```js
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)
}