Skip to content
This repository has been archived by the owner on Mar 13, 2024. It is now read-only.

A backend service that integrates Node.js with OpenAI ChatGPT.

License

Notifications You must be signed in to change notification settings

kentlouisetonino/node-chatgpt

Repository files navigation

DESCRIPTION

Screenshot from 2024-03-11 10-41-43


2024-03-11.04-06-19.mp4

  • A backend service that integrates Node.js with ChatGPT API.


LOCAL DEVELOPMENT

  • Create .env file and insert the key value pair below.
PORT=11000
  • Execute the scripts.
# Highly suggest to use Node.js version >= 18.
yarn install
yarn start

# To run the test.
yarn test:all
  • Use postman to send post request.
[REQUEST]
    Method: POST
    URL: http://localhost:11000/api/openai/chat
    Raw-JSON:
        "apiKey": "{{API_KEY}}",
        "model": "gpt-3.5-turbo",
        "messages": [{"role": "user", "content": "Say this is a test!"}],
        "temperature": 0.7
  • Further documentation can be found in OpenAI official docs.