Encoding plain text for ML API transmission