In this video we will build an AI chatbot from scratch using Node.js, the OpenAI library and the ChatGPT API.
Code:
[ Ссылка ]
Blog Post:
[ Ссылка ]
Check Out My Courses:
[ Ссылка ]
Timestamps:
0:00 - Intro
2:57 - Getting Setup
5:26 - OpenAI API Key
6:18 - OpenAI Library Setup
8:00 - Chat Completion Example
11:30 - Creating The Chatbot
13:42 - ReadlineSync Example
16:14 - Get User Input
18:05 - Exiting The Program
18:49 - Chat Completion for Chatbot
21:36 - Trying Out The Bot
22:13 - Storing The Chat History
25:22 - Update Chat History
26:05 - Final Test
![](https://i.ytimg.com/vi/1YU83Lw58eo/maxresdefault.jpg)