Example 8. Find the range of the function $y=\frac{x^{2}+x-1}{x^{2}+x+1}$.

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

Example 8. Find the range of the function $y=\frac{x^{2}+x-1}{x^{2}+x+1}$.
Given $y=1-\frac{2}{x^{2}+x+1}$, and $x^{2}+x+1=\left(x+\frac{1}{2}\right)^{2}+\frac{3}{4} \geqslant \frac{3}{4}$, thus, $0<\frac{2}{x^{2}+x+1} \leqslant \frac{8}{3}$, therefore, the range of the function $y=\frac{x^{2}+x-1}{x^{2}+x+1}$ is $\left[-\frac{5}{3}, 1\right)$.

Solution Guidance Directly using the basic properties of inequalities and combining the "squeeze method" (obtaining the relationship between the dependent variable $y$ and a constant through "squeezing") is also an important approach to obtaining conclusions related to the range of a function.