Takes a fragment of a webpage and uses ChatGPT to edit for brevity/clarity/etc while cleaning up and maintaining HTML.
Install the required stuff from composer: composer install
Copy the file 'blank_keys.php' & rename it 'keys.php' and fill in your OpenAi key.
- Cleans your HTML input.
- Converts the HTML to Markdown (ChatGPT seems to be much better at editing Markdown than HTML, seems to think all requests that are full of HTML are about HTML and not content).
- Passes the Markdown to ChatGPT for editing (Check out the variable '$prompt' to edit the prompt.
- Converts the Markdown back to HTML,
- Cleans the HTML once more.
- Output before and afters, diff, cost, etc!
Please note that this sends data to both DirtyMarkup for HTML formatting and of course sends your data off to OpenAI.