microsoft / TypeChat

TypeChat is a library that makes it easy to build natural language interfaces using types.
https://microsoft.github.io/TypeChat/
MIT License
8.16k stars 390 forks source link

Add `validateInstance` method to `TypeChatJsonTranslator` #115

Closed ahejlsberg closed 1 year ago

ahejlsberg commented 1 year ago

This PR adds a validateInstance method to the TypeChatJsonTranslator type. This function is called following successful schema validation of an instance. By default the function just returns a Success<T>, but an application can assign a new function that implements any additional validation.

Fixes #91.

caridy commented 1 year ago

This is great. Thanks for adding the additional hook.