The current model for TypeChat in Python is to construct a TypeScript schema and use it regardless of if there are issues with the input. This is possible because the translation process was designed to produce an approximation of some TypeScript schema while producing a set of errors.
Surprisingly, our math demo takes advantage of this, providing a Python type which can't be translated into a TS schema. But this still works well enough for the demo!
So by default, failure to construct a schema will now always raise an error; however, TypeChatProgramTranslator now takes an experimental named _raise_on_schema_errors parameter which can be specified as False to opt out of this behavior.
The current model for TypeChat in Python is to construct a TypeScript schema and use it regardless of if there are issues with the input. This is possible because the translation process was designed to produce an approximation of some TypeScript schema while producing a set of errors.
Surprisingly, our
math
demo takes advantage of this, providing a Python type which can't be translated into a TS schema. But this still works well enough for the demo!So by default, failure to construct a schema will now always raise an error; however,
TypeChatProgramTranslator
now takes an experimental named_raise_on_schema_errors
parameter which can be specified asFalse
to opt out of this behavior.