Giter VIP home page Giter VIP logo

tripteller's Introduction

TripTeller

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.

preview_redd_it-ehv4tdctj6sa1

Installation

  1. Clone this repository
git clone https://github.com/nitebyte/TripTeller.git
  1. Install the required modules:

    • openai
    • ebooklib
    • docx
    • requests
    • json
  2. Get an OpenAI API key here.

  3. Replace the api_key in the PR function and the headers dictionary with your OpenAI API key. Lines 18, 19, and 95.

  4. Run the program with the command:

python TripTeller.py
  1. Your completed travel guide book(s) will be saved as a .docx file in the same directory.

Usage

  1. The towns.csv file contains a list of towns in the format Town,State.
  2. Each town will have its own .txt file that contains the generated text for its travel guide.
  3. After running the program, the generated travel guide for each town will be saved as a .docx file in the same directory.
  4. To add or modify chapters or sections, edit the book variable in the TripTeller.py file.
  5. To change the number of tokens GPT-3.5 uses, modify the token parameter in the PR functions.
  6. To change the size of the images that DALL-E generates, modify the data dictionary in the txt_to_docx function.

tripteller's People

Contributors

nitebyte avatar

Stargazers

Bobby Maher avatar Jeff West avatar crusher avatar Javier Vizoso avatar Josh Luberisse avatar Jk avatar  avatar Mert Can Icpinar avatar  avatar Shutao SHEN avatar Gin avatar Walt avatar  avatar @Traderfuz avatar Bander Alsulami avatar  avatar Tim Kerby avatar  avatar  avatar  avatar  avatar pepo72 avatar  avatar mb avatar eunho avatar  avatar Austin Ray avatar Jor Vredeveld avatar Budhaditya avatar  avatar  avatar

Watchers

 avatar Josh Luberisse avatar  avatar  avatar

tripteller's Issues

Error:

Can you assist with this error?

Traceback (most recent call last):
File "C:\Users\Owner\Desktop\TripTeller-main\TripTeller.py", line 256, in
APD(response, savefile)
File "C:\Users\Owner\Desktop\TripTeller-main\TripTeller.py", line 35, in APD
f.write(text + "\n")
File "C:\Users\Owner\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u0107' in position 798: character maps to

Timeout means program failure

If there is a timeout when accessing OpenAI then the program stops completely. This means that temporary network problems or just a slow response will invalidate all the work done (and money spent) so far. A basic retry mechanism would overcome this. PR to follow.

Changing multiple locations for API key

Having to change the API key in three locations doesn't seem optimal. It would be better to have it in a single place and then used throughout. Might also be good to check that the key has been set and quit with an appropriate message if not. Will supply a PR for this.

Error:

This project is incredible, and I appreciate your hard work! When running the Python script, I receive the below error. The .txt file and .docx file are created successfully, but the error below is shown.
Traceback (most recent call last):
File "C:\Users\Owner\TripTeller-main\TripTeller.py", line 287, in
generate_amazon_description(savefile,town)
NameError: name 'generate_amazon_description' is not defined

Question 2. Do you have a version that can be used for creating travel guides for hiking trails and fishing places?

I appreciate any help you can provide.

Add prompt for user

It is not obvious to the user that the code is waiting for them to press Enter at the start to begin processing, a little prompt here would help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.