genkit icon indicating copy to clipboard operation
genkit copied to clipboard

[Go] [Draft] Added input/output validation for flows and actions and model output conformance.

Open apascal07 opened this issue 1 year ago • 0 comments

Summary of changes:

  • Flattened input schemas so the dev UI can auto-fill values for required fields.
  • Made Part fields exported because inferJSONSchema wasn't generating schema for them correctly which failed validation.
  • Added input validation pre-JSON unmarshaling to runJSON for both flows and actions. This is necessary because the unmarshaling throws away unknown/invalid fields and we want to enforce clean correct inputs. TODO: Display this error nicely in dev UI -- right now, it's unreadable and you need to look in the terminal for the actual error.
  • Added input/output validation to the core Run method for actions and Execute method for flows.
  • Added output conformance to Generate methods for model actions.

apascal07 avatar May 26 '24 00:05 apascal07