A couple of fairly harmless things you can do:
Its easiest to vacumn lightly around the pot itself, remove those flying buggers. You can also put up a sticky fly strip, they will get attracted to it and hopefully get stuck for good.
AFTER that you can put a 1/2 -1" layer of clean playsand on the top layer of the pot. The gnats have larvae in the soil and they won't burrow out of the sand as it hurts thier tender little bodies. Basically this breaks the life cycle of the gnats and they will die off. No sprays, no nasty chemicals needed.