Thanks for requesting me.
Without knowing the brand and model, it is impossible to give you much information other than the genset needs to be thoroughly diagnosed.
Repairs could potentially run anywhere from free (if you do your own work, and it just needs a good cleaning), to several thousand dollars.
If this unit is a brush type unit, it may just have dirty slip rings that can easily be cleaned in a few minutes, using nothing more than just a piece of sandpaper.
May it would be a bad brush, which can normally be bought for $10 - $20, and may only take 5 minutes to replace.
At the other far end of the spectrum, the stator and rotor may both have physical damage, and repairs could run into the thousands.
Since the engine does start and run, it is definitely worth having it looked at. Then once the problem is found, you can make a much more informed decision of repairing or replacing.