breadboard
breadboard copied to clipboard
add undefined to build package types
one for the wishlist @aomarks
undefined doesn't exist in JSON. We could do null, and there's also the concept of optional properties for an object type. We probably want both of those, but do you have a specific use case to pick one or the other?
the specific case this time is in the pop node again. Where the return can be an item of undefined.
This has just made me think of another case, const in JSON Schema.
I think we want all input/output values to be JSON serializable, probably. So, since undefined isn't, we may want to use null instead for the pop node. (So I think we should add null to the type system).
I just landed https://github.com/breadboard-ai/breadboard/pull/1231 which will ensure that we only return JSON serializable types from our nodes.
BTW, the main reason I think we want every value to be JSON serializable is so that we can easily support save/restore of runs.