Welcome to Duke Ignite 2023! We're glad you're here. This repository will show you how to use the ChatGPT API to generate text. You'll be able to chat with it here in your terminal. The goal of this workshop is to show you how you can incorporate the API into your projects this weekend. Happy hacking!
- Clone this repository and open a terminal window in your project directory
python3 -m venv venv
- creates a virtual environment where you can put your dependenciessource venv/bin/activate
- activates the virtual environmentpip install -r requirements.txt
- installs the dependencies- Go to OpenAI and get an API key (https://platform.openai.com/account/api-keys)
- Create a file called
.env
and add this line:OPENAI_API_KEY=YOUR OPEN AI KEY HERE FROM THE WEBSITE
- You can use my api key for this workshop:
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
python3 main.py
- runs the program
(Note: how to freeze the venv into requirements.txt: pip freeze > requirements.txt
)
This repo was put together by Joe Zakielarz, Duke '24.