2. If $|\omega|<6$, and the line $x=\frac{\pi}{6}$ is an axis of symmetry for the function $f(x)$ $=\sin \left(\omega x+\frac{\pi}{3}\right)$, then $\omega=$ $\qquad$
$$
2.0,1,-5 \text {. }
$$

First, $f(x)$ is not necessarily a trigonometric function; when $\omega=0$, it satisfies the condition.
Second, let $\sin \left(\omega \cdot \frac{\pi}{6}+\frac{\pi}{3}\right)= \pm 1$.
Solving this, we get $\omega=1,-5$.