6. Let $x>0$, the minimum value of the function $y=x^{2}-x+\frac{1}{x}$ is $\qquad$ .
6. 1. $y=(x-1)^{2}+\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}+1 \geqslant 1$.

Translate the text above into English, keeping the original text's line breaks and format, and output the translation result directly.

6. 1. $y=(x-1)^{2}+\left(\sqrt{x}-\frac{1}{\sqrt{x}}\right)^{2}+1 \geqslant 1$.