Decimate mesh with error threshold

I’m using the python api simplify_quadric_decimation to perform decimation and its working well. I’m wondering, however, if anyone can recommend a way to target an error threshold rather than a specific triangle count. I’d like to be able to say “decimate the mesh until the the error reaches a certain threshold, then stop.”