ChatGPT Automation
Automate repetitive LLM workflows, with ease.
Github Repository
The “ChatGPT Prompt Automation” tool automates repetitive ChatGPT workflows through the use of user-provided prompt templates, simple input handling, and web automation. In my SEO role, I often use ChatGPT to create skeleton drafts for SEO site content. Manually filling in these templates, submitting the prompts, and waiting for the response for each piece of content quickly became repetitive and time-consuming. This project was built to both streamline and automate that workflow. The tool allows users to define templates with a simple placeholder syntax, the program then automatically fills the template, submits the prompt to ChatGPT, and returns the response. The user only needs to select the prompt template and provide inputs for each placeholder; all execution is automated. Under the hood, it uses regex for parsing the template and SeleniumBase for the browser automation and interaction handling.
Architecture Highlights
- Regex-based template parsing system for dynamic prompt injection
- SeleniumBase automation layer to manage browser interaction and improve reliability
Key Features
- Custom user-provided templates
- Simple syntax for template inputs
- Automated prompt submission and response retrieval
Tech Stack
Utilities
- Python
- Regex (re module)
- SeleniumBase (browser automation)
Technical Challenges & Lessons Learned
- Automation Resistance
- ChatGPT's interface changes and additional security measures made reliable automation difficult. I addressed this issue by transitioning from Selenium to SeleniumBase (which has superior bot-protection handling) and by using more thoughtful DOM interaction strategies, more human-like automation behavior, and simplified automation steps.
- DOM + Selector Instability
- Frequent changes to ChatGPT's DOM caused selectors to regularly break. To improve the automation reliability, I initially created a multiple selector class (to check for the existence of multiple selectors). Later, I improved my approach by utilizing more precise selector choices.