Fix the issue of unexpected keyword argument 'endpoint_type'