Support Optional in Input (#2216)
* Add integration tests for pydantic 2 output
* Fix test case
* Add mode logging to invalid output
* Add support for Optionals in Input
* Remove Optional import from typing_extensions
* Handle python 3.8/3.9
* Fix > 3.9 check
* Fix >= 3.10
* Use None.__class__ to replace NoneType and type(None)
* Check if optional is Union