Replies: 5 comments 6 replies
-
We've heard this request several times so I'm pretty tempted to go ahead and implement it, but every time I think about it I run into this question in my mind: What use is non-conforming JSON coming back from the If I specify a specific schema for my data, and the returned data does not match that schema, is it still useful to me? Unless I write manual "repair" logic or have an additional "fix my bad JSON" generate call, I can't just pass through the result to my UI or downstream processing logic. That's not a reason not to offer the ability to disable schema validation, it's just something I keep thinking about. Would it be more useful if in addition to an |
Beta Was this translation helpful? Give feedback.
-
💯 I think some combination of automatic retrying and that level of verbosity would do the trick. Judging by how close I can get with fallback methods, I'd say more insight into the specific schema validation errors would probably address about 70% of the issues I've encountered. I'd say 15% of my issues are probably documentation related just because Genkit's still in beta, and maybe another 15% could be real edge cases where some kind of retry or repair logic would be helpful. I've been hesitant to implement any retry logic on my own just because some prompts seem to fail about 50% of the time, whereas similar prompts might fail 80% of the time. Thanks again for everyone's hard work on the Firebase team! |
Beta Was this translation helpful? Give feedback.
-
@mbleigh something that occurred to me today with validation errors is that I might want to feed those back into a "fixer" prompt as a follow up. It would therefore be useful to have the validation details returned so they're available for use downstream. I imagine this would be something of a pain to implement but I really do think it would be a useful aspect to the schema validation part of genkit. |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
For those of you who requested more helpful error messages...good news! #536 is pending 😄 |
Beta Was this translation helpful? Give feedback.
-
I'd really like to have a way to disable the strictness around schema validation for tool calls and JSON modes in genkit. I keep getting stung by models not quite getting the defined JSON structure right and these fail the very strict validation that
genkit
enforces. This is frustrating as I want to see what the model is struggling to get right at least but I don't get the opportunity becausegenkit
fails hard without any trace of the underlying structure that didn't validate.I'm using some pretty complex JSON API schemas (with discriminated unions and things), and having mostly a lot of joy, but little model "misunderstandings" are causing hard fails in genkit that are disrupting my ability to make quick trial-and-error adjustments. This problem definitely has a bit of overlap with the underlying model integrations, as they lack adequate logging for a quick glance from that side, so I think there are different approaches to take to help here. It's super frustrating with things the way they are at the moment though.
I'd be interested in hearing others thoughts on this!
Beta Was this translation helpful? Give feedback.
All reactions