-
In the documentation I can found this about the
What I understand, is that the LLM uses the provided zod schema to generate structured object according to it and also validate it. In my case, I use For example:const title = z.object({
type: z.literal('title'),
headingType: z.enum(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']),
content: z.string(),
}); If I prompt something slightly different like 'generate a heading', the type will likely be Is it a normal behaviour ? or maybe I'm doing it wrong. Thank you for your answer ! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Please try using |
Beta Was this translation helpful? Give feedback.
I would need to look at the details of how this is translated into a json schema by zod-to-json-schema. I know that for enums it can be tricky. We don't modify further on purpose to give you control through
describe
.