nsbradford / 20QuestionsWithGPT3

Minimal chat game with React, Next.js, and prompt engineering from the good old days.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

20 Questions with Sassy GPT-3

Using React, Next.js, and the OpenAI API.

See blog post: [upcoming]

Install

Assuming you have Node/npm (perhaps with nvm), simply clone this repo, and then from the repo root folder (with package.json in it) install dependencies:

$ npm install 

Get YOUR_API_KEY from OpenAI, and add it to your .env file so the app can use it for requests:

$ echo OPENAI_API_KEY=YOUR_API_KEY > .env

Now you're ready to run the server locally:

$ npm run dev

And just head over to http://localhost:3000 to play! It should look something like this. Note that the prompts have been designed to elicit some snark:

Sample chat

The AI has been prompted to say YOU WIN if you guess correctly, though this is imperfect. If you want to cheat, you can check the logs or developer console to see the chosen answer.

See the blog post for more.

About

Minimal chat game with React, Next.js, and prompt engineering from the good old days.


Languages

Language:TypeScript 79.9%Language:JavaScript 8.2%Language:SCSS 7.7%Language:CSS 4.3%