put vinegar in a glass and cover with cling film and pierce the film so there is a small hole. place this in the cage, the flies will be attracted to the vinegar, they cannot get out & will be trapped.
look on you tube - there are several methods
Get out the vacuum or shop vac and have at it.
I left my guinea pigs with family while I went out of town and their cages weren't cleaned the whole time I was gone. Now theirs a wall of small flies by their cages. I want to know how to kill them all with using bug spray.