In the figure, the vertex angle of $\triangle AOB$ varies within $\left(0, \frac{\pi}{2}\right)$, and $PQRS$ is an inscribed square in this sector (as shown in the figure). Try to find the minimum value of $OS$.

Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
2. Let $\angle A O B=\theta, O S=l$, then $P(l \cos \theta, 0)$, $S(l \cos \theta, l \sin \theta)$,
$$
\begin{array}{l}
R\left(\sqrt{1-l^{2} \sin ^{2} \theta}, l \sin \theta\right), Q\left(\sqrt{1-l^{2} \sin ^{2} \theta}, 0\right) . \\
\because P S=S R, \therefore l \sin \theta=\sqrt{1-l^{2} \sin ^{2} \theta}-l \cos \theta .
\end{array}
$$

Thus, $1-l^{2} \sin ^{2} \theta=l^{2}(\sin \theta+\cos \theta)^{2}=l^{2}(1+\sin 2 \theta)$.
$$
\begin{aligned}
\therefore 1 & =l^{2}\left(1+\sin 2 \theta+\sin ^{2} \theta\right) \\
& =l^{2}\left(\frac{3}{2}+\sin 2 \theta-\frac{1}{2} \cos 2 \theta\right) .
\end{aligned}
$$

Therefore, $l^{2}=\left(\frac{3}{2}+\sin 2 \theta-\frac{1}{2} \cos 2 \theta\right)^{-1}$.
$\because$ When $f(\theta)=\frac{3}{2}+\sin 2 \theta-\frac{1}{2} \cos 2 \theta$ is maximum, $l$ is minimum, and $f(\theta)=\frac{3}{2}+\frac{\sqrt{5}}{2} \sin (2 \theta-\varphi)$ $\left(\cos \varphi=\frac{2}{\sqrt{5}}, \sin \varphi=\frac{1}{\sqrt{5}}\right)$,
Clearly, when $\sin (2 \theta-\varphi)=1$, $f(\theta)$ is maximum, at this time, $f(\theta)=\frac{3}{2}+\frac{\sqrt{5}}{2}$.
Thus, the minimum value of $l$ is $\left(\frac{3}{2}+\frac{\sqrt{5}}{2}\right)^{-\frac{1}{2}}$
$$
=\left(\frac{1+\sqrt{5}}{2}\right)^{-1}=\frac{\sqrt{5}-1}{2} .
$$