chatgtp-node-js-api-call

1.4.2 • Public • Published

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)
}

/chatgtp-node-js-api-call/

    Package Sidebar

    Install

    npm i chatgtp-node-js-api-call

    Weekly Downloads

    4

    Version

    1.4.2

    License

    MIT

    Unpacked Size

    3.08 kB

    Total Files

    3

    Last publish

    Collaborators

    • programproductions