iamdual/ua-generator ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Python package that generates random but realistic user agent strings for Python 3.9 and up.
I want it to return the full user agent text, plus the related Client Hints data so it can be used right away with requests, httpx, urllib, or Selenium. It should support choosing device type, platform, and browser, and let me pass in one or more choices for each so it can pick randomly. Please also include a few simple options like preferring newer versions, limiting version ranges, and choosing only the latest versions for some browsers or platforms.
Keep it lightweight with no extra dependencies and no external downloads. The versions should be built in and based on real releases. Make the public API easy to use, with a simple generate function and a headers helper that returns the right request headers. If needed, look up the current docs online so the generated values stay realistic.
Are you gonna build this?
make sure you review the code using coderabbit