Back to Work

gptBookWriter

An early Python experiment that used a book outline to generate draft text one section at a time.

Status
Retired drafting experiment
Project dates
Approximately September–October 2023
Technology
PythonJSONFile processingOpenAI API

The problem

I wanted to see if I could automate the repeated work of turning outline sections into prompts and collecting the model's responses.

Audience

My own exploration of long-form drafting with AI.

My contribution

I planned the process in ChatGPT, moved the script changes into VS Code, and tested what came back as the tool worked through the outline.

Decisions

  • Use structured outline data and a prompt template to give each section a consistent starting point.

Workflow

The script parses the outline into JSON. It uses those sections to build prompts, calls the OpenAI API for each section, and collects the draft text.

Outcome

I used the workflow to generate a book draft. It showed me how to break a long generation task into smaller calls. I retired the project after deciding I did not want to sell AI-generated books.