use legacy.py for extract chat