  We present new $P -\phi_{31}-{\rm [Fe/H]}$ and $P -\phi_{31}- A_2 - {\rm
[Fe/H]}$ relations for fundamental-mode (RRab) and first-overtone mode (RRc) RR
Lyrae stars (RRLs), respectively. The relations were calibrated based on
pulsation periods and Fourier parameters of the RRL light curves in the Gaia
$G$-band published in the Gaia Data Release 3 (DR3), and accurate
spectroscopically measured metallicities available in the literature. We apply
the feature selection algorithm to identify the most relevant parameters for
the determination of metallicity. To fit the relations, we used the Bayesian
approach, which allowed us to carefully take into account uncertainties in
various parameters and the intrinsic scatter of the relations. The root mean
squared errors of the predicted metallicity values in the training samples are
0.28 dex and 0.21 dex for RRab and RRc stars, respectively, comparable with the
typical uncertainty of low/intermediate resolution spectroscopic metallicity
measurements. We applied the new relations to measure individual metallicities
and distances to $\sim$ 134,000 RRLs from the Gaia DR3 catalogue, as well as
mean metallicities and distances to 38 Milky Way globular clusters. We also
estimate the mean metallicity and distance to the Large Magellanic Cloud (LMC)
and Small Magellanic Cloud (SMC): ${\rm [Fe/H]_{LMC} = -1.63\pm0.36}$ and
$\mu_{\rm LMC}=18.55\pm0.18$~mag, ${\rm [Fe/H]_{SMC}=-1.86\pm0.36}$~dex and
$\mu_{\rm SMC}=19.01\pm 0.17$~mag, respectively, in excellent agreement with
previous measurements.
