SheetAgent: A Generalist Agent for Spreadsheet Reasoning and Manipulation via Large Language Models