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}$.