A language model chatbot developed by OpenAI based on GPT 3.5. Users can interact with bot, require chatbot to write, debug code and explain almost everything.
-
- Node.js: JavaScript runtime environment.
-
- Express: Node js web application framework.
-
- OpenAIApi: Performs a wide variety of natural language tasks, and Codex, which translates natural language to code.
-
- HTML
-
- CSS
-
- JavasSript
-
- Vite: Development environment for frameworks like Vue and React.
Run npm create vite@latest client --template vanilla
and choose vanilla as framework.
Sign up account in OpenAI to get the secret OPENAI_API_KEY
- 1. Run
npm install && npm run server
in one terminal - 2. Run
npm install && npm run dev
in another terminal
-
- Render to host server side and add OPENAI_API_KEY in the environment variable
-
- Vercel to host the client side
- Error message 401: it means OPENAI_API_KEY in configruation is unauthorized
Solution: make sure put the OPENAI_API_KEY in
.env
inside of server folder rather than the root directory.
- Uncaught TypeError: fail to fetch at ....
Solution: change the localhost 5000 link in script.js to the new server link from render and push again
- Free trial usage is $18 and API key will expire on May 1, 2023