You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a beginner question but I'm new to the aisdk and to AI engineering in general.
I have a scenario in the app I'm building where we transcribe a user audio input to text, and then use generateObject to get structure out of it.
In my initial testing, the model returns incorrect data to "fill" the schema in many of the test cases.
I'm wondering what are the best practices to enforce the model to not fill the schema and let me know the input is irrelevant.
I've been thinking about either using a zod discriminated union with a 'status' or a 'valid' field, or maybe having the schema fields nullable and a required valid/status field?
I know this might be more of a prompt/context engineering question but I appreciate the help :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
This might be a beginner question but I'm new to the aisdk and to AI engineering in general.
I have a scenario in the app I'm building where we transcribe a user audio input to text, and then use generateObject to get structure out of it.
In my initial testing, the model returns incorrect data to "fill" the schema in many of the test cases.
I'm wondering what are the best practices to enforce the model to not fill the schema and let me know the input is irrelevant.
I've been thinking about either using a zod discriminated union with a 'status' or a 'valid' field, or maybe having the schema fields nullable and a required valid/status field?
I know this might be more of a prompt/context engineering question but I appreciate the help :)
Beta Was this translation helpful? Give feedback.
All reactions