You can make a fabulous gnat trap with stuff on hand. Take a bowl and put fruit juice or juice and water, anything watery that will attract the gnats. Then stir in two or three drops of dish washing liquid and let it sit. You may need to change this every two or three days for a while. When it gets 40 or 50 gnats drowned on the bottom, the live ones seem to start avoiding it.
They will still continue to come in from outdoors, but this is a non-toxic way to get rid of the ones inside. That low level of dish soap won't do more than possibly give you a tummy ache if you accidentally drank it. But you won't be tempted, it will be filled with dead bodies.