This is a Java-based ChatGPT webapp that makes jokes based on a single word. You can access and clone the code via my GitHub account, with an introduction to the different classes and features.
USING AN OPENAI API KEY
Before running the solution, you need an OpenAI account, with credits and an API key to run the example solution.
You should add the API key as an environment variable, in the run configuration, so it does not get pushed to your GitHub.
NOTE: This image is taken from an IntelliJ run configuration.
THE EXAMPLES
The examples are made with a Java Spring backend, with 3 REST endpoints/features and a simple HTML page.
The 3 features are
- Feature 1: Get Joke, where your input is what the joke should be about.
- Feature 2: As above, but with IP-rate limitations (max 3 requests within a short time period).
- Feature 3: Using/responding with custom info that the ChatGPT API has not been trained with.



