Determining characteristics of a fluid in a wellbore