Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 2.04 KB

README.md

File metadata and controls

40 lines (26 loc) · 2.04 KB

ChatGPT Jokes Example

Shows how to use the ChatGPT API to make jokes based on the users input.

Image

This project was originally made by my fellow computer science lecturer Lars Mortensen (retired), from the Copenhagen School of Design & Technology.

It consists of a simple Java Spring backend and a browser-based frontend (HTML, CSS and JavaScript) page.

Backend

There are 3 different features (controllers) in the backend:

JokeController

Gets ChatGPT to create a joke, by passing an input, telling what the joke should be about.

JokeLimitedController

Does the same as above, but implements an IP-rate limitation (max. number of request in a small timeframe.)

OwnInfoController

Shows how to make custom responses that the ChatGPT AI has not been trained in.

Services

Frontend

Adding an API key

You have to create a OpenAI account with credits and an API key to run this example successfully.

Image