6. $F_{1}, F_{2}$ are the two foci of the ellipse $\frac{x^{2}}{a^{2}}+\frac{y^{2}}{b^{2}}=1(a>b>0)$, and $P$ is a point on the ellipse. If the area of $\triangle P F_{1} F_{2}$ is $1$, $\tan \angle P F_{1} F_{2}=\frac{1}{2}$, and $\tan \angle P F_{2} F_{1}=-2$. Then $a=$ $\qquad$
Make $P M \perp x$ axis, let $\left|F_{2} M\right|=x$, then
$$
\begin{array}{l}
\tan \angle P F_{2} M=2 \Rightarrow|P M|=2\left|F_{2} M\right|=2 x, \\
\tan \angle P F_{1} F_{2}=\frac{1}{2} \Rightarrow\left|F_{1} M\right|=2|P M|=4 x,
\end{array}
$$

Thus $\left|F_{1} F_{2}\right|=3 x \Rightarrow S_{\triangle P F_{1} F_{2}}=3 x^{2}=1$
$$
\Rightarrow x=\frac{\sqrt{3}}{3} \Rightarrow\left|F_{1} F_{2}\right|=\sqrt{3} \text {. }
$$

Notice that $\tan \angle F_{1} P F_{2}=\tan \left(\angle P F_{2} M-\angle P F_{1} F_{2}\right)$
$=\frac{2-\frac{1}{2}}{1+2 \cdot \frac{1}{2}}=\frac{3}{4} \Rightarrow \sin \angle F_{1} P F_{2}=\frac{3}{5}$, applying the Law of Sines in $\triangle P F_{1} F_{2}$,
$$
\begin{array}{l}
\frac{\left|P F_{2}\right|}{\sin \angle P F_{1} F_{2}}=\frac{\left|P F_{1}\right|}{\sin \angle P F_{2} F_{1}}=\frac{\left|F_{1} F_{2}\right|}{\sin \angle F_{1} P F_{2}} \\
\Rightarrow e=\frac{\left|F_{1} F_{2}\right|}{\left|P F_{1}\right|+\left|P F_{2}\right|}=\frac{\sin \angle F_{1} P F_{2}}{\sin \angle P F_{1} F_{2}+\sin \angle P F_{2} F_{1}}=\frac{\frac{3}{5}}{\frac{\sqrt{5}}{5}+\frac{2 \sqrt{5}}{5}}=\frac{\sqrt{5}}{5},
\end{array}
$$

So $2 a=\left|P F_{1}\right|+\left|P F_{2}\right|=\frac{\sqrt{3}}{e}=\sqrt{15} \Rightarrow a=\frac{\sqrt{15}}{2}$.