DocETL: Agentic Query Rewriting and Evaluation for Complex Document Processing