I'm a fairly young SWE in my early twenties, and I've tried a bit of everything.
Fullstack web dev, a bit of cyber security, a bit of AI, mobile apps, all kind of automation/bots/mass scraping, growth hacking, small games, low level C...
And I'm starting to wonder if I should specialize.
I've always been interested by AI, but since it's such a large/complex field, I never really took the time to dedicate myself to it completely because I'm always interested by 10 things at the same time.
I have absolutely zero doubts about my employability, but I'm afraid to regret it long term if I don't specialize in an interesting field.
Do you regret being a generalist? Have you been one in the past and then changed? In that case what do you prefer? Do you regret it?
I consider myself a "full stack employee". I've done backend, frontend, hosted live events, some sales, marketing, a dash of HR, pretty much everything.
Do I write that on my LinkedIn? Heck no. A year or so ago I looked at all the experience I had, saw I had a through-line story of how I've worked on video projects over the past 7ish years, and decided "I'm the frontend WebRTC guy." I identified the spots of knowledge I needed to read up on to be confident (just a few gaps here and there) interviewed at a job, and within 10 minutes into the interview my future (now current) boss said "You're the perfect fit!". Because I was. I'm the frontend WebRTC guy with some sales/marketing experience, and they needed a frontend WebRTC guy with some sales/marketing experience.
Before that, I was the Frontend DevOps guy. Before that, I was the Backbone.js guy. And before that, I was the Sharepoint guy (shhhhh don't tell anyone!)
If you're interested in AI, just go poke around and find something in AI. Don't sweat it. We all got plenty of time, and like you said, as long as we can center divs and set up click tracking on a Wordpress site we'll always be able to put food on the table! :)