Skip to content

A simple joke generation application using Tkinte, OpenAI GPT, and DALL·E to generate funny dad jokes and create images based on the jokes.

Notifications You must be signed in to change notification settings

AtaUllahB/DadJokes3000

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DadJoke 3000 with DALL·E

This is a simple joke generation application using Tkinter, OpenAI GPT, and DALL·E to generate funny dad jokes and create images based on the jokes.

Features

  • Dad Jokes Generator: Enter a topic, and the app generates a dad joke using OpenAI GPT.
  • Image Generation: The app also generates an illustration of the dad joke using the DALL·E API.
  • Simple UI: The app has a clean user interface built with Tkinter.
  • Clear Button: You can clear the input and reset the display with a single click.

How to Run

  1. Clone the repository:

    cd dadjoke3000

  2. Install the required dependencies:
    pip install -r requirements.txt
  3. Ensure you have a placeholder image in the root directory named placeholder_image.png (or update the code with your image path).
  4. Replace the OpenAI API key in the code:
    client = OpenAI(api_key='your-api-key')
  5. Run the app:
    python app.py

Dependencies

  • Tkinter: Provides the GUI framework.
  • OpenAI: Communicates with GPT and DALL·E for generating jokes and images.
  • Pillow: Handles image processing and display.
  • Requests: Fetches the generated image from DALL·E's API.

Usage

  1. Enter a joke subject (e.g., "bananas").
  2. Click "Get my dad joke!" to generate a joke and an image.
  3. Use the "Clear" button to reset the input and display.

License

This project is licensed under the MIT License. See the LICENSE file for details.