Self-healing Generate Object Function Call like Instructor #3255
feliche93
started this conversation in
Ideas & Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would love to see if there would be some functionality for the
generateObject
function like there is withinstructor
.The idea is in short, that if validation fails the output is put again into a function call with the zod validatin errors, so the model gets a second (or X number of chances) to "fix" any wrong output.
https://github.com/instructor-ai/instructor-js: https://github.com/instructor-ai/instructor-js/blob/1ff06f6fdad63988fafa2edddcab88ab572c9fcb/src/instructor.ts#L170
Probably using the
maxRetries
param for this could be confusing for other users, so not sure what the most elegant API design for this would be. 🤔Beta Was this translation helpful? Give feedback.
All reactions