Automated Travel Guide Writer
This program uses OpenAI's GPT-3.5 and DALL-E to generate an entire travel guide book for each town listed in the towns.csv
file. Each town's travel guide will have a preset list of chapters that GPT-3.5 will use to write the entire chapter. After all chapters are finished, they will be combined into a .docx
file and DALL-E will provide images for each chapter.
- Clone this repository
git clone https://github.com/nitebyte/TripTeller.git
-
Install the required modules:
openai
ebooklib
docx
requests
json
-
Get an OpenAI API key here.
-
Replace the
api_key
in thePR
function and theheaders
dictionary with your OpenAI API key. Lines 18, 19, and 95. -
Run the program with the command:
python TripTeller.py
- Your completed travel guide book(s) will be saved as a
.docx
file in the same directory.
- The
towns.csv
file contains a list of towns in the formatTown,State
. - Each town will have its own
.txt
file that contains the generated text for its travel guide. - After running the program, the generated travel guide for each town will be saved as a
.docx
file in the same directory. - To add or modify chapters or sections, edit the
book
variable in theTripTeller.py
file. - To change the number of tokens GPT-3.5 uses, modify the
token
parameter in thePR
functions. - To change the size of the images that DALL-E generates, modify the
data
dictionary in thetxt_to_docx
function.