generative-ai-js
generative-ai-js copied to clipboard
Allow Schema types to be written as inline string literals.
Declaring SchemaType as an enum means that users must reference the schema type off the enum, like SchemaType.OBJECT. That's useful, but it's also nice to be able to just write 'object', and with TypeScript that's equally type safe, IDEs are equally helpful with autocomplete, etc!
This is a backwards compatible change that allows users to write it either way.
I rebased and regenerated the docs
I had previously submitted the same PR here with a simpler approach https://github.com/google-gemini/generative-ai-js/pull/279
getting either of these merged in would be great